home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / Warp3D_Devel / Warp3D.doc < prev    next >
Encoding:
Text File  |  2001-06-20  |  145.6 KB  |  4,243 lines

  1. TABLE OF CONTENTS
  2.  
  3. Warp3D/W3D_AllocStencilBuffer
  4. Warp3D/W3D_AllocTexObj
  5. Warp3D/W3D_AllocZBuffer
  6. Warp3D/W3D_BestModeID
  7. Warp3D/W3D_BindTexture
  8. Warp3D/W3D_CheckDriver
  9. Warp3D/W3D_CheckIdle
  10. Warp3D/W3D_ClearDrawRegion
  11. Warp3D/W3D_ClearStencilBuffer
  12. Warp3D/W3D_ClearZBuffer
  13. Warp3D/W3D_ColorPointer
  14. Warp3D/W3D_CreateContext
  15. Warp3D/W3D_DestroyContext
  16. Warp3D/W3D_DrawArray
  17. Warp3D/W3D_DrawElements
  18. Warp3D/W3D_DrawLine
  19. Warp3D/W3D_DrawLineLoop
  20. Warp3D/W3D_DrawLineStrip
  21. Warp3D/W3D_DrawPoint
  22. Warp3D/W3D_DrawTriangle
  23. Warp3D/W3D_DrawTriangleV
  24. Warp3D/W3D_DrawTriFan
  25. Warp3D/W3D_DrawTriFanV
  26. Warp3D/W3D_DrawTriStrip
  27. Warp3D/W3D_DrawTriStripV
  28. Warp3D/W3D_FillStencilBuffer
  29. Warp3D/W3D_Flush
  30. Warp3D/W3D_FlushFrame
  31. Warp3D/W3D_FlushTextures
  32. Warp3D/W3D_FreeAllTexObj
  33. Warp3D/W3D_FreeScreenmodeList
  34. Warp3D/W3D_FreeStencilBuffer
  35. Warp3D/W3D_FreeTexObj
  36. Warp3D/W3D_FreeZBuffer
  37. Warp3D/W3D_GetDestFmt
  38. Warp3D/W3D_GetDrivers
  39. Warp3D/W3D_GetDriverState
  40. Warp3D/W3D_GetDriverTexFmtInfo
  41. Warp3D/W3D_GetScreenmodeList
  42. Warp3D/W3D_GetState
  43. Warp3D/W3D_GetTexFmtInfo
  44. Warp3D/W3D_Hint
  45. Warp3D/W3D_LockHardware
  46. Warp3D/W3D_Query
  47. Warp3D/W3D_QueryDriver
  48. Warp3D/W3D_ReadStencilPixel
  49. Warp3D/W3D_ReadStencilSpan
  50. Warp3D/W3D_ReadZPixel
  51. Warp3D/W3D_ReadZSpan
  52. Warp3D/W3D_ReleaseTexture
  53. Warp3D/W3D_RequestMode
  54. Warp3D/W3D_SetAlphaMode
  55. Warp3D/W3D_SetBlendMode
  56. Warp3D/W3D_SetChromaTestBounds
  57. Warp3D/W3D_SetColorMask
  58. Warp3D/W3D_SetCurrentColor
  59. Warp3D/W3D_SetCurrentPen
  60. Warp3D/W3D_SetDrawRegion
  61. Warp3D/W3D_SetDrawRegionWBM
  62. Warp3D/W3D_SetFilter
  63. Warp3D/W3D_SetFogParams
  64. Warp3D/W3D_SetFrontFace
  65. Warp3D/W3D_SetLogicOp
  66. Warp3D/W3D_SetPenMask
  67. Warp3D/W3D_SetScissor
  68. Warp3D/W3D_SetState
  69. Warp3D/W3D_SetStencilFunc
  70. Warp3D/W3D_SetStencilOp
  71. Warp3D/W3D_SetTexEnv
  72. Warp3D/W3D_SetWrapMode
  73. Warp3D/W3D_SetWriteMask
  74. Warp3D/W3D_SetZCompareMode
  75. Warp3D/W3D_TestMode
  76. Warp3D/W3D_TexCoordPointer
  77. Warp3D/W3D_UnLockHardware
  78. Warp3D/W3D_UpdateTexImage
  79. Warp3D/W3D_UpdateTexSubImage
  80. Warp3D/W3D_UploadTexture
  81. Warp3D/W3D_VertexPointer
  82. Warp3D/W3D_WaitIdle
  83. Warp3D/W3D_WriteStencilPixel
  84. Warp3D/W3D_WriteStencilSpan
  85. Warp3D/W3D_WriteZPixel
  86. Warp3D/W3D_WriteZSpan
  87. Warp3D/W3D_AllocStencilBuffer                          Warp3D/W3D_AllocStencilBuffer
  88.  
  89.    NAME
  90.        W3D_AllocStencilBuffer -- Allocate stencil buffer
  91.  
  92.    SYNOPSIS
  93.        success =  W3D_AllocStencilBuffer(context);
  94.        d0                                a0
  95.  
  96.        ULONG W3D_AllocStencilBuffer(W3D_Context *);
  97.  
  98.    FUNCTION
  99.        Allocate a stencil buffer for the given context. For more
  100.        information on stencil buffering, see the OpenGL specs.
  101.  
  102.    INPUTS
  103.        context - The context the stencil buffer is allocated on
  104.  
  105.    RESULT
  106.        One of the following values:
  107.            W3D_SUCCESS         The allocation was successful
  108.            W3D_NOGFXMEM        No memory was left on the graphics board
  109.            W3D_NOSTENCILBUFFER Stencil buffering is not available
  110.  
  111.    EXAMPLE
  112.  
  113.    NOTES
  114.        Stencil buffering and the ViRGE: The ViRGE is not capable of stencil
  115.        buffering, it became a necessity later when hardware accelerators
  116.        started to support the OpenGL standard.
  117.  
  118.    BUGS
  119.  
  120.    SEE ALSO
  121.        W3D_FreeStencilBuffer
  122.  
  123. Warp3D/W3D_AllocTexObj                                        Warp3D/W3D_AllocTexObj
  124.  
  125.    NAME
  126.        W3D_AllocTexObj -- Allocate a new texture object
  127.  
  128.    SYNOPSIS
  129.        texture = W3D_AllocTexObj(context, error, ATOTags);
  130.        d0                        a0       a1     a2
  131.  
  132.        W3D_Texture *W3D_AllocTexObj(W3D_Context, ULONG *, struct TagItem *);
  133.  
  134.    FUNCTION
  135.        Create a new texture object. Such a texture object contains
  136.        information about a texture in addition to the normal image data
  137.        that is displayed.
  138.  
  139.    INPUTS
  140.        context - pointer to a W3D_Context
  141.        error   - pointer to a ULONG, which will contain an error code,
  142.                    or NULL if you do not want to get the error code.
  143.        ATOTags - pointer to a taglist. Supported tags are:
  144.                    W3D_ATO_IMAGE (mandatory):
  145.                          A pointer to the source texture image
  146.                    W3D_ATO_FORMAT (mandatory):
  147.                          The texture format of the source texture. Must be
  148.                          one of the following values (check the include file
  149.                          for more precise definition):
  150.                          - W3D_CHUNKY
  151.                          - W3D_A1R5G5B5
  152.                          - W3D_R5G6B5
  153.                          - W3D_R8G8B8
  154.                          - W3D_A4R4G4B4
  155.                          - W3D_A8R8G8B8
  156.                          - W3D_R8G8B8A8
  157.                          - W3D_A8
  158.                          - W3D_L8
  159.                          - W3D_L8A8
  160.                          - W3D_I8
  161.                    W3D_ATO_WIDTH (mandatory):
  162.                          The width of the texture in pixels. Must
  163.                          be 2^n.
  164.                    W3D_ATO_HEIGHT (mandatory):
  165.                          The height of the texture in pixels. Must
  166.                          be 2^n.
  167.                    W3D_ATO_MIPMAP (optional):
  168.                          If specified, the texture can be used for mipmapping.
  169.                          The value of this tag defines, which mipmap levels
  170.                          have to be generated automatically. It should be set
  171.                          so that the generated mipmaps and the provided ones
  172.                          build a complete mipmap set.
  173.                          The value is a bitmask with one specific bit
  174.                          representing a mipmap level. Bit 0 corresponds to
  175.                          level 1, Bit 1 to level 2, so Bit n to level n-1.
  176.                          A value of 0 means, that all mipmaps are provided
  177.                          by the application.
  178.                          Note, that providing only a part of all mipmaps
  179.                          which leave holes between the provided levels may
  180.                          result in performance loss.
  181.                    W3D_ATO_MIPMAPPTRS (mandatory for user-supplied mipmaps)
  182.                          If W3D_ATO_MIPMAP is specified, mipmapping is used
  183.                          for texturing. The mipmap mask specifies which of the
  184.                          mipmaps will be created. With the W3D_ATO_MIPMAPPTRS tag,
  185.                          an array of (void *) to the mipmaps you want to
  186.                          supply yourself is defined. This array must be
  187.                          NULL-Terminated
  188.                          Example: You want to give only level 3 and 5, and
  189.                          let W3D_AllocTexObj create the rest of the mipmaps.
  190.                          Assume a 128x128 texture (7 mipmap levels)
  191.                          Define an array like this:
  192.                            void *mips[3];
  193.                            mips[0] = (void *)level_3_map;
  194.                            mips[1] = (void *)level_5_map;
  195.                            mips[2] = NULL;
  196.                          When calling W3D_AllocTexObj, you would give
  197.                          W3D_ATO_MIPMAP the value 0x6B (binary 1101011)
  198.                          W3D_ATO_MIPMAPPTRS would be mips.
  199.                    W3D_ATO_PALETTE (mandatory for chunky textures):
  200.                          Defines the palette which is necessary to handle
  201.                          chunky textures. A pointer to a palette must be
  202.                          provided. The palette itself is an array of
  203.                          ULONG's, and every ULONG defines the ARGB value
  204.                          for one color index. Therefore the palette must
  205.                          be 1024 bytes. (Note: On 8bit screens, this
  206.                          palette *should* be the screen palette,
  207.                          unless the driver returns TRUE on W3D_Q_PALETTECONV.)
  208.  
  209.    RESULT
  210.        Either a pointer to the successfully created texture
  211.        object, or NULL, in which case the optional error variable
  212.        is set to one of the following values:
  213.            W3D_SUCCESS             It worked!
  214.            W3D_ILLEGALINPUT        Some information was invalid, maybe
  215.                                      a mandatory tag missing
  216.            W3D_NOMEMORY            No memory was available
  217.            W3D_UNSOPPORTEDTEXSIZE  The driver can`t handle a texture
  218.                                      of the given size.
  219.            W3D_NOPALETTE           The texture should be a chunky (CLUT)
  220.                                      texture, but no palette was given.
  221.            W3D_UNSUPPORTEDTEXFMT   The format can not be used with the
  222.                                      current driver
  223.  
  224.    EXAMPLE
  225.        extern W3D_Context *context;
  226.        void *image = LoadImage("texture.iff");
  227.        W3D_Texture *texobj;
  228.        struct TagItem tags[] = {
  229.            W3D_ATO_IMAGE,      image,
  230.            W3D_ATO_FORMAT,     W3D_A1R5G5B5,
  231.            W3D_ATO_WITDH,      128,
  232.            W3D_ATO_HEIGHT,     128,
  233.            TAG_DONE,           0
  234.        };
  235.        ULONG error;
  236.  
  237.        texobj = W3D_AllocTexObj(context, &error, tags);
  238.        if (!texobj)
  239.            printf("An error has occurred because: An error has occurred (%d)\n",
  240.                        error);
  241.  
  242.  
  243.    NOTES
  244.        The pointers to textures and mipmaps passed to this function are
  245.        considered `locked` until this texture object is released again,
  246.        or the image is updated with W3D_UpdateTexImage.
  247.        You may not free the memory.
  248.  
  249.    BUGS
  250.  
  251.    SEE ALSO
  252.        W3D_FreeTexObj, W3D_ReleaseTexture, W3D_UpdateTexImage,
  253.        W3D_FlushTextures, W3D_SetFilter, W3D_SetTexEnv, W3D_SetWrapMode
  254.        W3D_UploadTexture
  255.  
  256. Warp3D/W3D_AllocZBuffer                                      Warp3D/W3D_AllocZBuffer
  257.  
  258.    NAME
  259.        W3D_AllocZBuffer -- Allocate a ZBuffer
  260.  
  261.    SYNOPSIS
  262.        result = W3D_AllocZBuffer(context);
  263.        d0                        a0
  264.  
  265.        ULONG W3D_AllocZBuffer(W3D_Context *);
  266.  
  267.    FUNCTION
  268.        Allocates a ZBuffer. The size of the ZBuffer depends on the
  269.        size of the bitmap used with this context. The memory is allocated
  270.        on the graphics board.
  271.  
  272.    INPUTS
  273.        context - pointer to the context to be used with the ZBuffer
  274.  
  275.    RESULT
  276.        One of the following values:
  277.            W3D_SUCCESS     The allocation was successful
  278.            W3D_NOGFXMEM    Not enough video memory
  279.            W3D_NOZBUFFER   ZBuffering is not available on this hardware
  280.            W3D_NOTVISIBLE  - The bitmap is not visible/swapped out of vmem
  281.  
  282.    EXAMPLE
  283.        ULONG error, status;
  284.        struct BitMap myBitMap;
  285.        struct TagItem taglist[] = {
  286.            W3D_CC_BITMAP,      (ULONG)&myBitMap,
  287.            W3D_CC_YOFFSET,     0,
  288.            W3D_CC_DRIVERTYPE,  W3D_DRIVER_BEST
  289.        };
  290.        W3D_Context *context;
  291.  
  292.        InitBitMap(&myBitMap, 15, 640, 480);
  293.        createPlanes(&myBitMap);
  294.        context = W3D_CreateContext(&error, taglist);
  295.        status = W3D_AllocZBuffer(context);
  296.  
  297.    NOTES
  298.        This function should be called before textures are uploaded to
  299.        the graphics board, to avoid fragmentation of video memory.
  300.  
  301.    BUGS
  302.  
  303.    SEE ALSO
  304.        W3D_FreeZBuffer
  305.  
  306. Warp3D/W3D_BestModeID                                          Warp3D/W3D_BestModeID
  307.  
  308.    NAME
  309.        W3D_BestModeID -- Find a suitable ModeID (V3)
  310.  
  311.    SYNOPSIS
  312.        ModeID = W3D_BestModeID(tags);
  313.        ModeID = W3D_BestModeIDTags(Tag1, ...);
  314.  
  315.        ULONG W3D_BestModeID(struct TagItem *tags);
  316.        ULONG W3D_BestModeIDTags(Tag tag1, ...);
  317.  
  318.    FUNCTION
  319.        Returns a screen mode ID that best fits the parameters
  320.        supplied in the tag list.
  321.  
  322.    INPUTS
  323.        tags - a taglist, consisting of the following possible tag item:
  324.            W3D_BMI_DRIVER          Must work with this driver
  325.            W3D_BMI_WIDTH           Must have approximately this width
  326.            W3D_BMI_HEIGHT          Must have approximately this height
  327.            W3D_BMI_DEPTH           Must have at least this depth
  328.  
  329.    RESULT
  330.        ModeID - A screenmode ID or INVALID_ID in case of error
  331.  
  332.    EXAMPLE
  333.  
  334.    NOTES
  335.  
  336.    BUGS
  337.  
  338.    SEE ALSO
  339. Warp3D/W3D_BindTexture                                        Warp3D/W3D_BindTexture
  340.  
  341.    NAME
  342.        W3D_BindTexture - set the current Texture (V4)
  343.  
  344.    SYNOPSIS
  345.        error = W3D_BindTexture(context, tmu, texture);
  346.        D0                        A0      D0   A1
  347.  
  348.        ULONG W3D_BindTexture(W3D_Context*, ULONG, W3D_Texture*);
  349.  
  350.    FUNCTION
  351.        This function specifies the texture to use for the next call to
  352.        W3D_DrawArray or W3D_DrawElements. If the texture parameter
  353.        is NULL, the binding is cancelled, and the texture object
  354.        may be deleted without danger.
  355.  
  356.        The texture need not be in video ram. If it isn't, it is automatically
  357.        uploaded if AUTOTEXMANAGEMENT is enabled.
  358.  
  359.    INPUTS
  360.        context - pointer to a context obtained by W3D_CreateContext
  361.        tmu     - must be zero
  362.        texture - pointer to a W3D_Texture object.
  363.  
  364.    RESULT
  365.        Currently this function always returns W3D_SUCCESS
  366.  
  367.    EXAMPLE
  368.  
  369.    NOTES
  370.        You may not delete a texture object that is bound with this
  371.        function unless you reset the binding by calling this function
  372.        with NULL as a texture pointer. Otherwise the next drawing operation
  373.        might crash.
  374.  
  375.        Currently the bound texture object is *ONLY* valid for W3D_DrawArray
  376.        or W3D_DrawElements. Traditional drawing operations still require
  377.        the texture to be specified in the appropriate structure.
  378.  
  379.        For the time being only one TMU is supported, so the tmu argument
  380.        must be zero.
  381.  
  382.        No sanity checks are done. It is the programmers resposibility not
  383.        to use illegal TMU's
  384.  
  385.    BUGS
  386.  
  387.    SEE ALSO
  388.        W3D_VertexPointer, W3D_ColorPointer, W3D_TexCoordPointer,
  389.        W3D_DrawArray, W3D_DrawElements
  390.  
  391. Warp3D/W3D_CheckDriver                                        Warp3D/W3D_CheckDriver
  392.  
  393.    NAME
  394.        W3D_CheckDriver -- Check driver availability
  395.  
  396.    SYNOPSIS
  397.        flags = W3D_CheckDriver();
  398.        d0
  399.  
  400.        ULONG W3D_CheckDriver(void);
  401.  
  402.    FUNCTION
  403.        Checks what driver is available (CPU/HW), and returns it
  404.        as a bit mask.
  405.  
  406.    INPUTS
  407.        None
  408.  
  409.    RESULT
  410.        A long word that has it`s bit set accordingly:
  411.            W3D_DRIVER_3DHW - A hardware driver is available
  412.            W3D_DRIVER_CPU  - A software driver is available
  413.  
  414.    EXAMPLE
  415.        ULONG flags = W3D_CheckDriver();
  416.        if (flags & W3D_DRIVER_3DHW) printf("Hardware driver available\n");
  417.        if (flags & W3D_DRIVER_CPU)  printf("Software driver available\n");
  418.  
  419.    NOTES
  420.        This function can be called without a valid context. It can
  421.        be used to evaluate the possibilities the system is offering.
  422.        Note though, that you should give the user a chance to get into
  423.        your program, even if you think it would be too slow without
  424.        hardware acceleration...
  425.  
  426.    BUGS
  427.  
  428.    SEE ALSO
  429.  
  430. Warp3D/W3D_CheckIdle                                            Warp3D/W3D_CheckIdle
  431.  
  432.    NAME
  433.        W3D_CheckIdle -- check if hardware is working
  434.  
  435.    SYNOPSIS
  436.        working = W3D_CheckIdle(context);
  437.        d0                      a0
  438.  
  439.        ULONG W3D_CheckIdle(W3D_Context *);
  440.  
  441.    FUNCTION
  442.        Check if the hardware is finished with it`s current operation.
  443.  
  444.    INPUTS
  445.        context - a pointer to a W3D_Context
  446.  
  447.    RESULT
  448.        One of to values indicating busy/idle state:
  449.            W3D_SUCCESS - The hardware is idle
  450.            W3D_BUSY    - The hardware is still working
  451.  
  452.    EXAMPLE
  453.  
  454.    NOTES
  455.        This function is not very useful for applications.
  456.  
  457.    BUGS
  458.  
  459.    SEE ALSO
  460.        W3D_WaitIdle
  461.  
  462. Warp3D/W3D_ClearDrawRegion                                Warp3D/W3D_ClearDrawRegion
  463.  
  464.    NAME
  465.        W3D_ClearDrawRegion -- Clear the current drawing area
  466.  
  467.    SYNOPSIS
  468.        success = W3D_ClearDrawRegion(context, color);
  469.        d0                            a0       d0
  470.  
  471.        ULONG W3D_ClearDrawRegion(W3D_Context *, ULONG);
  472.  
  473.    FUNCTION
  474.        ClearDrawRegion clears the current drawing area to the color
  475.        given by color. The operation may performed with the boards
  476.        blitter, so this is the prefered way for clearing. Additionally,
  477.        this call makes using V39 multibuffering easier by prociding
  478.        a way to clear the back buffer.
  479.  
  480.    INPUTS
  481.        context - A pointer to the context to use
  482.        color   - The color value to clear to. For direct color drawing
  483.                  regions (i.e. TrueColor/HiColor), this is a 32 bit
  484.                  color value in the form ARGB, with each component 8 bit.
  485.                  For 8 bit (palettized) screens, it's an 8 bit color
  486.                  index. Note that for the first form, the color is
  487.                  always 8 bits per component, regardless of the color
  488.                  format of the drawing region (15/16/24/32 bit).
  489.  
  490.    RESULT
  491.        One of the following:
  492.            W3D_SUCCESS         The operation was successful
  493.            W3D_NOTVISIBLE      The contex was not in locked state
  494.  
  495.    EXAMPLE
  496.  
  497.    NOTES
  498.        W3D_NOTVISIBLE is a bit misleading. The drawing area must not
  499.        be visible on the screen to be clear, but the context must be
  500.        locked, so that the screen buffer is in memory
  501.  
  502.    BUGS
  503.  
  504.    SEE ALSO
  505.  
  506. Warp3D/W3D_ClearStencilBuffer                          Warp3D/W3D_ClearStencilBuffer
  507.  
  508.    NAME
  509.        W3D_ClearStencilBuffer -- Clear the stencil buffer
  510.  
  511.    SYNOPSIS
  512.        success = W3D_ClearStencilBuffer(context, clearval);
  513.        d0                               a0       a1
  514.  
  515.        ULONG W3D_ClearStencilBuffer(W3D_Context *, ULONG *);
  516.  
  517.    FUNCTION
  518.        Clear the stencil buffer (fill it up) with the value
  519.        pointed to by clearval.
  520.        This function may only be used while the hardware is locked,
  521.        except when indirect drawing is used.
  522.  
  523.    INPUTS
  524.        context  - the context to work on
  525.        clearval - pointer to a value used for clearing
  526.  
  527.    RESULT
  528.        One of the following:
  529.            W3D_SUCCESS         Operation was successful
  530.            W3D_NOSTENCILBUFFER Stencil buffer not present (not allocated,
  531.                                    or not supported by driver)
  532.            W3D_NOTVISIBLE      The stencil buffer can not be accessed by
  533.                                    the hardware
  534.            W3D_QUEUEFAILED     In indirect mode only. Queueing this request
  535.                                    failed
  536.  
  537.    EXAMPLE
  538.  
  539.    NOTES
  540.  
  541.    BUGS
  542.  
  543.    SEE ALSO
  544.        W3D_AllocStencilBuffer, W3D_FreeStencilBuffer
  545.  
  546. Warp3D/W3D_ClearZBuffer                                      Warp3D/W3D_ClearZBuffer
  547.  
  548.    NAME
  549.        W3D_ClearZBuffer -- Clear the ZBuffer with a given value
  550.  
  551.    SYNOPSIS
  552.        success = W3D_ClearZBuffer(context, clearvalue);
  553.        d0                         a0       a1
  554.  
  555.        ULONG W3D_ClearZBuffer(W3D_Context *, W3D_Double *);
  556.  
  557.    FUNCTION
  558.        Clear the ZBuffer with a given value.
  559.        This function may only be used while the hardware is locked,
  560.        except when indirect drawing is used.
  561.  
  562.    INPUTS
  563.        context     - pointer to the context
  564.        clearvalue  - pointer to a W3D_Double, ranging from [0..1].
  565.                      If NULL, 0.0 is used
  566.  
  567.    RESULT
  568.        One of the following values:
  569.            W3D_SUCCESS     operation successful
  570.            W3D_NOZBUFFER   No ZBuffer was allocated
  571.            W3D_NOTVISIBLE  The ZBuffer was not in video ram
  572.            W3D_QUEUEFAILED     In indirect mode only. Queueing this request
  573.                                    failed
  574.  
  575.    EXAMPLE
  576.  
  577.    NOTES
  578.  
  579.    BUGS
  580.  
  581.    SEE ALSO
  582.        W3D_AllocZBuffer, W3D_FreeZBuffer
  583.  
  584. Warp3D/W3D_ColorPointer                                      Warp3D/W3D_ColorPointer
  585.  
  586.    NAME
  587.        W3D_ColorPointer - Set the color value pointer (V4)
  588.  
  589.    SYNOPSIS
  590.        error = W3D_ColorPointer(context, pointer, stride, format, mode, flags);
  591.        D0                        A0      A1        D0      D1     D2     D3
  592.  
  593.        ULONG W3D_ColorPointer(W3D_Context*, void*, ULONG, ULONG, ULONG);
  594.  
  595.    FUNCTION
  596.        Sets the pointer for obtaining vertex color info. Data is fetched
  597.        from the address pointed to by the pointer parameter.
  598.  
  599.        When color data is needed for element <n>, the pointer is cast to an
  600.        UBYTE* and n*stride is added to this pointer. The result is cast back
  601.        to a pointer as determined by the format parameter, and used for color
  602.        data lookup according to mode.
  603.  
  604.    INPUTS
  605.        context - pointer to a context obtained by W3D_CreateContext
  606.        pointer - pointer to the texture array data or NULL to delete the pointer.
  607.        stride  - array stride, i.e. the byte offset from one element to
  608.                  the next.
  609.        format  - the format of the color data. The following is allowed:
  610.            W3D_COLOR_FLOAT         all color components are floats in the
  611.                                    range 0.0 .. 1.0
  612.            W3D_COLOR_UBYTE         all color components are UBYTEs in
  613.                                    the range 0 .. 255
  614.        mode    - the color mode used. The following is alloed
  615.            W3D_CMODE_RGB           three components red, green and blue
  616.            W3D_CMODE_BGR           three components of blue, green and red
  617.            W3D_CMODE_RGBA          four components red, green, blue and alpha
  618.            W3D_CMODE_ARGB          four components alpha, red, green and blue
  619.            W3D_CMODE_BGRA          four components blue, green, red and alpha
  620.        flags   - MUST be set to 0 for now.
  621.  
  622.    RESULT
  623.        error   - either W3D_SUCCESS or an error code. The following errors
  624.            may occur:
  625.  
  626.            W3D_SUCCESS         - no error
  627.            W3D_ILLEGALINPUT    - driver cannot handle this layout
  628.  
  629.    EXAMPLE
  630.        W3D_Vertex VertArray[1000];     // Vertex array
  631.        ULONG error = W3D_ColorPointer(context, (void *)VertArray+32,
  632.            sizeof(W3D_Vertex), W3D_COLOR_FLOAT, W3D_CMODE_RGBA, 0);
  633.  
  634.  
  635.    NOTES
  636.        Array pointers may be interleaved. That means that using the W3D_Vertex
  637.        structures as an array works even when you use the color and texture
  638.        coordinate pointers pointing to the same structures.
  639.  
  640.        Offsets and stride may be negative. No assumptions are made about these,
  641.        and no sanity checks are performed.
  642.  
  643.    BUGS
  644.  
  645.    SEE ALSO
  646.        W3D_VertexPointer, W3D_ColorPointer
  647.  
  648. Warp3D/W3D_CreateContext                                    Warp3D/W3D_CreateContext
  649.  
  650.    NAME
  651.        W3D_CreateContext -- Create a new Warp3D context
  652.  
  653.    SYNOPSIS
  654.        context = W3D_CreateContext(&error, CCTags);
  655.        D0                          A0      A1
  656.  
  657.        W3D_Context *W3D_CreateContext(ULONG *, struct TagItem *);
  658.  
  659.    FUNCTION
  660.        This function creates a new Warp3D context, which is required by most
  661.        other API functions as first parameter.
  662.  
  663.        The number of open contexts is not limited. Full multitasking capabilities
  664.        are provided.
  665.  
  666.    INPUTS
  667.        error   - A pointer to a ULONG which gets the error value,
  668.                    or NULL if you don`t want an error code returned
  669.        CCTags  - A taglist containing various input parameters:
  670.            W3D_CC_MODEID (special):
  671.                  Specifies the ModeID of the screen you opened or
  672.                  intend to open, or generally the ModeID of the drawing
  673.                  area you intend to use. If you plan to use Warp3D in
  674.                  windowed mode, you may leave this tag unset. Otherwise,
  675.                  the tag MUST be set correctly, as the ModeID is used to
  676.                  extract the required hardware.
  677.            W3D_CC_BITMAP (mandatory):
  678.                  A pointer to the bitmap which is used for 3D drawing.
  679.                  For 3DHW drivers, the bitmap must absolutely be located
  680.                  in video memory (it may be swapped out at the moment).
  681.                  For CPU drivers, it doesn't matter, where the bitmap is
  682.                  located. Note, that CPU drivers might use FAST-RAM
  683.                  buffers for intermediate results to speed up rendering,
  684.                  therefore bitmaps in FAST-RAM might not be optimal in
  685.                  this case.
  686.                  Also note, that never bitmaps should be provided which
  687.                  are directly visible!
  688.            W3D_CC_YOFFSET (mandatory):
  689.                  A vertical offset, which defines, at which Y-Position
  690.                  the drawing area starts. This can be used to achieve
  691.                  multibuffering using the ScrollVPort trick, which might
  692.                  be the only possibility to achieve proper multibuffering
  693.                  with some graphics interface software.
  694.            W3D_CC_DRIVERTYPE (mandatory):
  695.                  A constant which defines what type of driver should
  696.                  be used (use the API function W3D_CheckDriver to get
  697.                  more information about the drivers). Possible values
  698.                  are:
  699.                  - W3D_DRIVER_BEST       the best driver is chosen
  700.                  - W3D_DRIVER_3DHW       the hardware driver is chosen,
  701.                                             if none is present, NULL is
  702.                                             returned
  703.                  - W3D_DRIVER_CPU        the software driver is chosen,
  704.                                             if none is present, NULL is
  705.                                             returned
  706.            W3D_CC_W3DBM (optional):
  707.                  Boolean tag. If this is set to TRUE, the W3D_CC_BITMAP
  708.                  tag doesn't point to a struct BitMap. Instead, it points
  709.                  to a Warp3D bitmap (of type W3D_Bitmap), which might
  710.                  be in fast-ram (for CPU rendering). Note that the
  711.                  W3D_CC_YOFFSET tag is ignored if W3D_CC_W3DBM is set
  712.                  to TRUE.
  713.            W3D_CC_INDIRECT (optional):
  714.                  Boolean tag. If set to TRUE, then all drawing actions are
  715.                  possibly not performed directly, but are queued until
  716.                  the buffer is full, or W3D_Flush is called, or the
  717.                  indirect state is switched off with W3D_SetState
  718.            W3D_CC_GLOBALTEXENV (optional):
  719.                  Boolean tag. If set to TRUE, calls to SetTexEnv do not
  720.                  modify the given texture, but are used for all textures.
  721.            W3D_CC_DOUBLEHEIGHT (optional):
  722.                  Boolean tag. This tag should be set to TRUE if the drawing
  723.                  area is a double height screen. Double height screens
  724.                  may be used for double buffering with CyberGraphX.
  725.            W3D_CC_FAST: (optional):
  726.                  Boolean tag. If set to TRUE, drawing functions are allowed
  727.                  to modify the passed structures.
  728.  
  729.  
  730.    RESULT
  731.        A pointer to a newly created context structure, or NULL for failure.
  732.        If an error variable was provided, the error value is filled in.
  733.        It may be one of the following values:
  734.            W3D_SUCCESS         - Operation was successful
  735.            W3D_ILLEGALINPUT    - Illegal input, maybe a left out tag item
  736.            W3D_NOMEMORY        - Unable to get enough memory
  737.            W3D_NODRIVER        - No driver was available
  738.            W3D_UNSUPPORTEDFMT  - The supplied bitmap can`t be supported
  739.            W3D_ILLEGALBITMAP   - The bitmap is not properly initialised
  740.  
  741.    EXAMPLE
  742.        ULONG error;
  743.        struct BitMap myBitMap;
  744.        struct TagItem taglist[] = {
  745.            W3D_CC_BITMAP,      (ULONG)&myBitMap,
  746.            W3D_CC_YOFFSET,     0,
  747.            W3D_CC_DRIVERTYPE,  W3D_DRIVER_BEST
  748.        };
  749.        W3D_Context *context;
  750.  
  751.        InitBitMap(&myBitMap, 15, 640, 480);
  752.        createPlanes(&myBitMap);
  753.        context = W3D_CreateContext(&error, taglist);
  754.  
  755.    NOTES
  756.        An error of type W3D_UNSUPPORTEDFMT is returned if a W3D_Bitmap
  757.        is given as drawregion and no CPU driver is available, or
  758.        a HW driver is also requested.
  759.  
  760.    BUGS
  761.  
  762.    SEE ALSO
  763.        W3D_DestroyContext, W3D_Flush, W3D_SetState
  764.  
  765. Warp3D/W3D_DestroyContext                                  Warp3D/W3D_DestroyContext
  766.  
  767.    NAME
  768.        W3D_DestoryContext -- Release a Warp3D context
  769.  
  770.    SYNOPSIS
  771.        W3D_DestoryContext(context);
  772.                           A0
  773.  
  774.        void W3D_DestroyContext(W3D_Context *);
  775.  
  776.    FUNCTION
  777.        This function frees up all resources for the given context,
  778.        destroying it.
  779.  
  780.    INPUTS
  781.        context - Pointer to a Warp3D context
  782.  
  783.    RESULT
  784.        None
  785.  
  786.    EXAMPLE
  787.        W3D_Context *context;
  788.        ...
  789.        context = W3D_CreateContext(.....);
  790.        ...
  791.        W3D_DestroyContext(context);
  792.  
  793.    NOTES
  794.        Always release contexts. Even if the memory loss doesn't kill you,
  795.        the hardware may be blocked.
  796.  
  797.    BUGS
  798.  
  799.    SEE ALSO
  800.        W3D_CreateContext
  801.  
  802. Warp3D/W3D_DrawArray                                            Warp3D/W3D_DrawArray
  803.  
  804.    NAME
  805.        W3D_DrawArray - draw primitives based on array data (V4)
  806.  
  807.    SYNOPSIS
  808.        error = W3D_DrawArray(context, primitive, base, count);
  809.        D0                        A0      D0       D1    D2
  810.  
  811.        ULONG W3D_DrawArray(W3D_Context*, ULONG, ULONG, ULONG);
  812.  
  813.    FUNCTION
  814.        Draws a primitive based on the current array pointers.
  815.        Basically, this function is equivalent to the appropriate
  816.        pre-V4 drawing function. However, there is no W3D_Triangle
  817.        or similar structure; input data for this function is taken
  818.        fomr the VertexPointer, TexCoordPointer and ColorPointer
  819.        functions.
  820.  
  821.        The first vertex is fetched from the array element <base>.
  822.        Subsequent data is fetched from <base+1>, <base+2) and
  823.        so on until <count> elements have been read. An error is
  824.        returned if <count> does not match the number of vertices
  825.        needed by the specified primitive type; for example, it
  826.        is an error to specify W3D_PRIMITIVE_TRIANGLES with only
  827.        2 vertices.
  828.  
  829.        All rules for the drawing functions still apply. All states
  830.        are honored (except W3D_INDIRECT, which should be considered
  831.        depricated).
  832.  
  833.    INPUTS
  834.        context     - pointer to a context obtained by W3D_CreateContext
  835.        primitive   - the primitive type to draw. The following are valid:
  836.            W3D_PRIMITIVE_TRIANGLES - draws <count>/3 triangles
  837.            W3D_PRIMITIVE_TRIFAN    - draws a triangle fan
  838.            W3D_PRIMITIVE_TRISTRIP  - draws a triangle strip
  839.            W3D_PRIMITIVE_POINTS    - draws <count> points
  840.            W3D_PRIMITIVE_LINES     - draws <count>/2 disjoint lines
  841.            W3D_PRIMITIVE_LINELOOP  - draws a line loop
  842.            W3D_PRIMITIVE_LINESTRIP - draws a line strip (open loop)
  843.        base        - the array index of the first element to draw
  844.        count       - the number of array elements to use
  845.  
  846.    RESULT
  847.        error   - either W3D_SUCCESS or an error code. The following errors
  848.            may occur:
  849.  
  850.            W3D_SUCCESS         - no error
  851.            W3D_ILLEGALINPUT    - not enough vertex data.
  852.            W3D_NOTEXTURE       - Texture is missing for texture mapping.
  853.            W3D_TEXNOTRESIDENT  - Texture is not resident and autotexture management
  854.                                  is disabled
  855.            W3D_NOTVISIBLE      - drawing area is not in video ram
  856.            W3D_NOZBUFFER       - zbuffer not present but zbuffering requested
  857.            W3D_NOMEMORY        - The operation failed because it required
  858.                                  memory but could not allocate it.
  859.  
  860.    EXAMPLE
  861.        W3D_Vertex VertArray[1000];     // Vertex array
  862.        error = W3D_DrawArray(context, W3D_PRIMITIVE_TRIANGLES, 0, 3);
  863.  
  864.    NOTES
  865.        If a pointer is unspecified but the current state vector asks for
  866.        it, an error W3D_ILLEGALINPUT is generated. The same applies if the
  867.        count argument specifies too few entries. It is not an error to
  868.        have no TexCoord pointer, for example, when texture mapping is
  869.        disabled. If W3D_GOURAUD is enabled, the color pointer must be
  870.        present, otherwise the color data is fetched (as normally) from
  871.        W3D_CurrentColor or W3D_CurrentPen.
  872.  
  873.        Note also that there is no such concept as an array size. Data
  874.        is fetched from the arrays without bounds check. It is the
  875.        programmers responsibility to ensure that indices never go out
  876.        of bounds.
  877.  
  878.        The W3D_NOMEMORY error might be generated when a driver or the
  879.        API library emulation of the array feature required memory for
  880.        temporary storage but could not obtain it.
  881.  
  882.    BUGS
  883.  
  884.    SEE ALSO
  885.        W3D_VertexPointer, W3D_ColorPointer, W3D_TexCoordPointer,
  886.        W3D_DrawElements
  887.  
  888. Warp3D/W3D_DrawElements                                      Warp3D/W3D_DrawElements
  889.  
  890.    NAME
  891.        W3D_DrawElements - draw an indexed primitive (V4)
  892.  
  893.    SYNOPSIS
  894.        error = W3D_DrawElements(context, primitive, type, count, indices);
  895.        D0                        A0       D0         D1    D2     A1
  896.  
  897.        ULONG W3D_DrawElements(W3D_Context*, ULONG, ULONG, ULONG, void*);
  898.  
  899.    FUNCTION
  900.        This function is very similar to the W3D_DrawArray function. Unlike
  901.        W3D_DrawArray, this function does not draw primitives based on consecutive
  902.        array elements but rather based on an array of indices passed to the
  903.        function.
  904.  
  905.        Like W3D_DrawArray, the primitive parameter specifies the type of primitive
  906.        to draw. The type argument specifies the layout of the indices array (more on
  907.        that in a moment). The count specifies the number of indices to fetch from th
  908. e
  909.        index array. Finally, the indices parameter points to the array of indices.
  910.  
  911.        The type argument is used to specify the data type of the indices. There are
  912.        three possible values W3D_INDEX_UBYTE, W3D_INDEX_USHORT and W3D_INDEX_ULONG.
  913.        Accordingly the pointer is advanced by one, two or four bytes on each
  914.        subsequent index fetch.
  915.  
  916.    INPUTS
  917.        context     - pointer to a context obtained by W3D_CreateContext
  918.        primitive   - the primitive type to draw. The following are valid:
  919.            W3D_PRIMITIVE_TRIANGLES - draws <count>/3 triangles
  920.            W3D_PRIMITIVE_TRIFAN    - draws a triangle fan
  921.            W3D_PRIMITIVE_TRISTRIP  - draws a triangle strip
  922.            W3D_PRIMITIVE_POINTS    - draws <count> points
  923.            W3D_PRIMITIVE_LINES     - draws <count>/2 disjoint lines
  924.            W3D_PRIMITIVE_LINELOOP  - draws a line loop
  925.            W3D_PRIMITIVE_LINESTRIP - draws a line strip (open loop)
  926.        type        - the data type of the indices. Possible values are
  927.            W3D_INDEX_UBYTE     - indices are 8 bit unsigned
  928.            W3D_INDEX_UWORD     - indices are 16 bit unsigned
  929.            W3D_INDEX_ULONG     - indice are 32 bit unsigned.
  930.        count       - the number of array elements to use
  931.        indices     - typeless pointer to the array of indices.
  932.  
  933.    RESULT
  934.        error   - either W3D_SUCCESS or an error code. The following errors
  935.            may occur:
  936.  
  937.            W3D_SUCCESS         - no error
  938.            W3D_ILLEGALINPUT    - not enough vertex data.
  939.            W3D_NOTEXTURE       - Texture is missing for texture mapping.
  940.            W3D_TEXNOTRESIDENT  - Texture is not resident and autotexture management
  941.                                  is disabled
  942.            W3D_NOTVISIBLE      - drawing area is not in video ram
  943.            W3D_NOZBUFFER       - zbuffer not present but zbuffering requested
  944.  
  945.    EXAMPLE
  946.        W3D_Vertex VertArray[1000];     // Vertex array
  947.        UBYTE indices[] = {1, 2, 3, 0, 4, 3, 1, 2, 5};
  948.        error = W3D_DrawElements(context,
  949.            W3D_PRIMITIVE_TRIANGLES, W3D_INDEX_UBYTE, 9,
  950.            (void *)indices);
  951.  
  952.    NOTES
  953.        If a pointer is unspecified but the current state vector asks for
  954.        it, an error W3D_ILLEGALINPUT is generated. The same applies if the
  955.        count argument specifies too few entries. It is not an error to
  956.        have no TexCoord pointer, for example, when texture mapping is
  957.        disabled. If W3D_GOURAUD is enabled, the color pointer must be
  958.        present, otherwise the color data is fetched (as normally) from
  959.        W3D_CurrentColor or W3D_CurrentPen.
  960.  
  961.        Note also that there is no such concept as an array size. Data
  962.        is fetched from the arrays without bounds check. It is the
  963.        programmers responsibility to ensure that indices never go out
  964.        of bounds.
  965.  
  966.        The same applies to the indices array - there is no bounds check done,
  967.        so an out-of-array access might result in an access violation error
  968.        or worse. In a locked state, the requester opening might freeze the
  969.        machine entirely.
  970.  
  971.    BUGS
  972.  
  973.    SEE ALSO
  974.        W3D_VertexPointer, W3D_ColorPointer, W3D_TexCoordPointer,
  975.        W3D_DrawArray
  976.  
  977. Warp3D/W3D_DrawLine                                              Warp3D/W3D_DrawLine
  978.  
  979.    NAME
  980.        W3D_DrawLine -- Draw a three-dimensional line
  981.  
  982.    SYNOPSIS
  983.        success = W3D_DrawLine(context, line);
  984.        d0                     a0       a1
  985.  
  986.        ULONG W3D_DrawLine(W3D_Context *, W3D_Line *);
  987.  
  988.    FUNCTION
  989.        This function draws a line based on the current state.
  990.        It may only be used while the hardware is locked, except when
  991.        indirect drawing is used.
  992.  
  993.    INPUTS
  994.        context - The context to be drawn in
  995.        line    - Definition of a line.
  996.  
  997.    RESULT
  998.        A value inidcating success or failure. One of the following:
  999.            W3D_SUCCESS         (you guessed it!)
  1000.            W3D_NOTEXTURE       The line has no texture
  1001.            W3D_TEXNOTRESIDENT  The required texture is not in video ram
  1002.            W3D_NOGFXMEM        No memory available on the graphics card
  1003.            W3D_NOTVISIBLE      The drawing area is not visible
  1004.            W3D_NOZBUFFER       No ZBuffer
  1005.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1006.  
  1007.    EXAMPLE
  1008.  
  1009.    NOTES
  1010.        The linewidth parameter will probably not be supported
  1011.        by most 3D hardware.
  1012.  
  1013.    BUGS
  1014.  
  1015.    SEE ALSO
  1016.  
  1017. Warp3D/W3D_DrawLineLoop                                      Warp3D/W3D_DrawLineLoop
  1018.  
  1019.    NAME
  1020.        W3D_DrawLineLoop -- Draw a closed sequence of connected lines (V2)
  1021.  
  1022.    SYNOPSIS
  1023.        success = W3D_DrawLineLoop(context, lines);
  1024.        d0                          a0       a1
  1025.  
  1026.        ULONG W3D_DrawLineLoop(W3D_Context *, W3D_Lines *);
  1027.  
  1028.    FUNCTION
  1029.        This function draws a connected sequence of lines, similar to
  1030.        the W3D_DrawLineStrip function. The only difference is that the
  1031.        last vertex is connected to the first with a line segment, too,
  1032.        meaning that the vertexcount lines are drawn.
  1033.  
  1034.    INPUTS
  1035.        context     - pointer to the context.
  1036.        lines       - pointer to the W3D_Lines (not the trailing 's')
  1037.                      structure defining the line strip.
  1038.  
  1039.    RESULT
  1040.        One of the following:
  1041.            W3D_SUCCESS         It worked.
  1042.            W3D_NOTEXTURE       No texture given
  1043.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1044.            W3D_NOTVISIBLE      The drawing area is not visible
  1045.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1046.            W3D_ILLEGALINPUT    Fewer than two vertices were given
  1047.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1048.  
  1049.    EXAMPLE
  1050.  
  1051.    NOTES
  1052.  
  1053.    BUGS
  1054.        Currently, this call is not queued.
  1055.  
  1056.    SEE ALSO
  1057.        W3D_DrawLineLoop, W3D_DrawLine
  1058.  
  1059. Warp3D/W3D_DrawLineStrip                                    Warp3D/W3D_DrawLineStrip
  1060.  
  1061.    NAME
  1062.        W3D_DrawLineStrip -- Draw a sequence of connected lines (V2)
  1063.  
  1064.    SYNOPSIS
  1065.        success = W3D_DrawLineStrip(context, lines);
  1066.        d0                          a0       a1
  1067.  
  1068.        ULONG W3D_DrawLineStrip(W3D_Context *, W3D_Lines *);
  1069.  
  1070.    FUNCTION
  1071.        Draws a sequence of connected lines (a line strip). The first
  1072.        line is defined by vertices 0 and 1, the second line by vertices
  1073.        1 and 2, ..., up to the last line being defined by vertices
  1074.        n-1 and n, with n being the vertexcount field from the W3D_Lines
  1075.        structure.
  1076.  
  1077.    INPUTS
  1078.        context     - pointer to the context.
  1079.        lines       - pointer to the W3D_Lines (not the trailing 's')
  1080.                      structure defining the line strip.
  1081.  
  1082.    RESULT
  1083.        One of the following:
  1084.            W3D_SUCCESS         It worked.
  1085.            W3D_NOTEXTURE       No texture given
  1086.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1087.            W3D_NOTVISIBLE      The drawing area is not visible
  1088.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1089.            W3D_ILLEGALINPUT    Fewer than two vertices were given
  1090.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1091.  
  1092.    EXAMPLE
  1093.  
  1094.    NOTES
  1095.  
  1096.    BUGS
  1097.        Currently, this call is not queued.
  1098.  
  1099.    SEE ALSO
  1100.        W3D_DrawLineLoop, W3D_DrawLine
  1101.  
  1102. Warp3D/W3D_DrawPoint                                            Warp3D/W3D_DrawPoint
  1103.  
  1104.    NAME
  1105.        W3D_DrawPoint -- Draw a point
  1106.  
  1107.    SYNOPSIS
  1108.        success = W3D_DrawPoint(context, point);
  1109.        d0                      a0       a1
  1110.  
  1111.        ULONG W3D_DrawPoint(W3D_Context *, W3D_Point *);
  1112.  
  1113.    FUNCTION
  1114.        Draw a point based on the current context
  1115.        It may only be used while the hardware is locked, except when
  1116.        indirect drawing is used.
  1117.  
  1118.    INPUTS
  1119.        context - a pointer to the context to draw with
  1120.        point   - a pointer to a filled W3D_Point
  1121.  
  1122.    RESULT
  1123.        One of the following:
  1124.            W3D_SUCCESS         It worked.
  1125.            W3D_NOTEXTURE       No texture given
  1126.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1127.            W3D_NOTVISIBLE      The drawing area is not visible
  1128.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1129.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1130.  
  1131.    EXAMPLE
  1132.  
  1133.    NOTES
  1134.        The pointsize parameter will probably not be supported by most
  1135.        3D hardware.
  1136.  
  1137.        Although the vertex has it's own color, the GOURAUD shading state
  1138.        must be enabled to use this color, otherwise the current color set
  1139.        by W3D_SetCurrentColor/W3D_SetCurrentPen will be used.
  1140.  
  1141.    BUGS
  1142.  
  1143.    SEE ALSO
  1144.  
  1145. Warp3D/W3D_DrawTriangle                                      Warp3D/W3D_DrawTriangle
  1146.  
  1147.    NAME
  1148.        W3D_DrawTriangle -- Draw a triangle
  1149.  
  1150.    SYNOPSIS
  1151.        success = W3D_DrawTriangle(context, triangle);
  1152.        d0                         a0       a1
  1153.  
  1154.        ULONG W3D_DrawTriangle(W3D_Context *, W3D_Triangle *);
  1155.  
  1156.    FUNCTION
  1157.        Draw a triangle to the given context, based on that context`s
  1158.        state.
  1159.        It may only be used while the hardware is locked, except when
  1160.        indirect drawing is used.
  1161.  
  1162.    INPUTS
  1163.        context     - the context to be drawn to
  1164.        triangle    - the triangle to be drawn
  1165.  
  1166.    RESULT
  1167.        One of the following:
  1168.            W3D_SUCCESS         It worked.
  1169.            W3D_NOTEXTURE       No texture given
  1170.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1171.            W3D_NOTVISIBLE      The drawing area is not visible
  1172.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1173.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1174.  
  1175.    EXAMPLE
  1176.  
  1177.    NOTES
  1178.  
  1179.    BUGS
  1180.  
  1181.    SEE ALSO
  1182.        W3D_DrawTriFan, W3D_DrawTriStrip
  1183.  
  1184. Warp3D/W3D_DrawTriangleV                                    Warp3D/W3D_DrawTriangleV
  1185.  
  1186.    NAME
  1187.        W3D_DrawTriangleV -- Draw a triangle
  1188.  
  1189.    SYNOPSIS
  1190.        success = W3D_DrawTriangleV(context, triangle);
  1191.        d0                         a0       a1
  1192.  
  1193.        ULONG W3D_DrawTriangleV(W3D_Context *, W3D_TriangleV *);
  1194.  
  1195.    FUNCTION
  1196.        Draw a triangle to the given context, based on that context`s
  1197.        state.
  1198.        It may only be used while the hardware is locked.
  1199.        Indirect drawing is not supported by this call.
  1200.        This is the "vectorized" version; instead of inlined vertex
  1201.        structures, it uses pointers.
  1202.  
  1203.    INPUTS
  1204.        context     - the context to be drawn to
  1205.        triangle    - the triangle to be drawn
  1206.  
  1207.    RESULT
  1208.        One of the following:
  1209.            W3D_SUCCESS         It worked.
  1210.            W3D_NOTEXTURE       No texture given
  1211.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1212.            W3D_NOTVISIBLE      The drawing area is not visible
  1213.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1214.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1215.  
  1216.    EXAMPLE
  1217.  
  1218.    NOTES
  1219.        Requires Warp3D V3
  1220.  
  1221.    BUGS
  1222.  
  1223.    SEE ALSO
  1224.        W3D_DrawTriFanV, W3D_DrawTriStripV
  1225.  
  1226. Warp3D/W3D_DrawTriFan                                          Warp3D/W3D_DrawTriFan
  1227.  
  1228.    NAME
  1229.        W3D_DrawTriFan -- Draw a triangle fan
  1230.  
  1231.    SYNOPSIS
  1232.        success = W3D_DrawTriFan(context, triangles);
  1233.        d0                       a0       a1
  1234.  
  1235.        ULONG W3D_DrawTriFan(W3D_Context *, W3D_Triangles *);
  1236.  
  1237.    FUNCTION
  1238.        Draw a triangle fan. The first vertex in the list is
  1239.        considered the common point for the fan. For more
  1240.        information on triangle fans, see the OpenGL specs.
  1241.        This function may only be used while the hardware is locked,
  1242.        except when indirect drawing is used.
  1243.  
  1244.    INPUTS
  1245.        context     - pointer to the context.
  1246.        triangles   - pointer to a vertex list. Note that this
  1247.                      is a W3D_Triangles (trailing s, avoid mixing
  1248.                      up with W3D_Traingle)
  1249.  
  1250.    RESULT
  1251.        One of the following:
  1252.            W3D_SUCCESS         It worked.
  1253.            W3D_NOTEXTURE       No texture given
  1254.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1255.            W3D_NOTVISIBLE      The drawing area is not visible
  1256.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1257.            W3D_ILLEGALINPUT    Less than three vertices were given
  1258.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1259.  
  1260.    EXAMPLE
  1261.  
  1262.    NOTES
  1263.  
  1264.    BUGS
  1265.  
  1266.    SEE ALSO
  1267.        W3D_DrawTriangle, W3D_DrawTriStrip
  1268.  
  1269. Warp3D/W3D_DrawTriFanV                                        Warp3D/W3D_DrawTriFanV
  1270.  
  1271.    NAME
  1272.        W3D_DrawTriFanV -- Draw a triangle fan
  1273.  
  1274.    SYNOPSIS
  1275.        success = W3D_DrawTriFanV(context, triangles);
  1276.        d0                       a0       a1
  1277.  
  1278.        ULONG W3D_DrawTriFanV(W3D_Context *, W3D_TrianglesV *);
  1279.  
  1280.    FUNCTION
  1281.        Draw a triangle fan. The first vertex in the list is
  1282.        considered the common point for the fan. For more
  1283.        information on triangle fans, see the OpenGL specs.
  1284.        This function may only be used while the hardware is locked.
  1285.        Indirect drawing is not supported by this call.
  1286.        This is the "vectorized" version. Instead of suplying a
  1287.        pointer to an array of vertex structure, you supply a pointer
  1288.        to an array of vertex structure pointers.
  1289.  
  1290.    INPUTS
  1291.        context     - pointer to the context.
  1292.        triangles   - pointer to a vertex list. Note that this
  1293.                      is a W3D_TrianglesV (trailing s, avoid mixing
  1294.                      up with W3D_TraingleV)
  1295.  
  1296.    RESULT
  1297.        One of the following:
  1298.            W3D_SUCCESS         It worked.
  1299.            W3D_NOTEXTURE       No texture given
  1300.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1301.            W3D_NOTVISIBLE      The drawing area is not visible
  1302.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1303.            W3D_ILLEGALINPUT    Less than three vertices were given
  1304.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1305.            W3D_NOMEMORY        The feature should have been emulated since the
  1306.                                driver does not support it, but memory alloc failed.
  1307.  
  1308.    EXAMPLE
  1309.  
  1310.    NOTES
  1311.        Requires Warp3D V3
  1312.  
  1313.    BUGS
  1314.  
  1315.    SEE ALSO
  1316.        W3D_DrawTriangleV, W3D_DrawTriStripV
  1317.  
  1318. Warp3D/W3D_DrawTriStrip                                      Warp3D/W3D_DrawTriStrip
  1319.  
  1320.    NAME
  1321.        W3D_DrawTriStrip -- Draw a triangle strip
  1322.  
  1323.    SYNOPSIS
  1324.        success = W3D_DrawTriStrip(context, triangles);
  1325.        d0                       a0       a1
  1326.  
  1327.        ULONG W3D_DrawTriStrip(W3D_Context *, W3D_Triangles *);
  1328.  
  1329.    FUNCTION
  1330.        Draw a triangle strip. For more information
  1331.        on triangle strips, see the OpenGL specs.
  1332.        This function may only be used while the hardware is locked,
  1333.        except when indirect drawing is used.
  1334.  
  1335.    INPUTS
  1336.        context     - pointer to the context.
  1337.        triangles   - pointer to a vertex list. Note that this
  1338.                      is a W3D_Triangles (trailing s, avoid mixing
  1339.                      up with W3D_Traingle)
  1340.  
  1341.    RESULT
  1342.        One of the following:
  1343.            W3D_SUCCESS         It worked.
  1344.            W3D_NOTEXTURE       No texture given
  1345.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1346.            W3D_NOTVISIBLE      The drawing area is not visible
  1347.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1348.            W3D_ILLEGALINPUT    Less than three vertices were given
  1349.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1350.  
  1351.    EXAMPLE
  1352.  
  1353.    NOTES
  1354.  
  1355.    BUGS
  1356.  
  1357.    SEE ALSO
  1358.        W3D_DrawTriangle, W3D_DrawTriFan
  1359.  
  1360. Warp3D/W3D_DrawTriStripV                                    Warp3D/W3D_DrawTriStripV
  1361.  
  1362.    NAME
  1363.        W3D_DrawTriStripV -- Draw a triangle strip
  1364.  
  1365.    SYNOPSIS
  1366.        success = W3D_DrawTriStripV(context, triangles);
  1367.        d0                       a0       a1
  1368.  
  1369.        ULONG W3D_DrawTriStripV(W3D_Context *, W3D_TrianglesV *);
  1370.  
  1371.    FUNCTION
  1372.        Draw a triangle strip. For more information
  1373.        on triangle strips, see the OpenGL specs.
  1374.        This function may only be used while the hardware is locked.
  1375.        Indirect drawing is not supported for this function.
  1376.        This is the "vectorized" version. Instead of suplying a
  1377.        pointer to an array of vertex structure, you supply a pointer
  1378.        to an array of vertex structure pointers.
  1379.  
  1380.    INPUTS
  1381.        context     - pointer to the context.
  1382.        triangles   - pointer to a vertex list. Note that this
  1383.                      is a W3D_Triangles (trailing s, avoid mixing
  1384.                      up with W3D_Traingle)
  1385.  
  1386.    RESULT
  1387.        One of the following:
  1388.            W3D_SUCCESS         It worked.
  1389.            W3D_NOTEXTURE       No texture given
  1390.            W3D_TEXNOTRESIDENT  The texture is not on the graphics board`s memory
  1391.            W3D_NOTVISIBLE      The drawing area is not visible
  1392.            W3D_NOZBUFFER       No ZBuffer present, although it has been requested
  1393.            W3D_ILLEGALINPUT    Less than three vertices were given
  1394.            W3D_QUEUEFAILED     The request can't be queued in indirect mode
  1395.  
  1396.    EXAMPLE
  1397.  
  1398.    NOTES
  1399.  
  1400.    BUGS
  1401.  
  1402.    SEE ALSO
  1403.        W3D_DrawTriangle, W3D_DrawTriFan
  1404.  
  1405. Warp3D/W3D_FillStencilBuffer                            Warp3D/W3D_FillStencilBuffer
  1406.  
  1407.    NAME
  1408.        W3D_FillStencilBuffer -- Fill the stencil buffer
  1409.  
  1410.    SYNOPSIS
  1411.        success = W3D_FillStencilBuffer(context, x, y, width, height, depth, data);
  1412.        d0                              a0       d0 d1 d2     d3      d4     a1
  1413.  
  1414.        ULONG W3D_FillStencilBuffer(W3D_Context *, ULONG, ULONG, ULONG, ULONG,
  1415.                            ULONG, void *);
  1416.  
  1417.    FUNCTION
  1418.        This function fills the stencil buffer with a rectangular image
  1419.        with the given dimensions.
  1420.        This function may only be used while the hardware is locked,
  1421.        except when indirect drawing is used.
  1422.  
  1423.    INPUTS
  1424.        context - the context
  1425.        x,y     - Coordinates into the stencil buffer
  1426.        width   - Width of the image data
  1427.        height  - Height of the image data
  1428.        depth   - Depth of the image data. Must be 8,16 or 32
  1429.        data    - The data itself
  1430.  
  1431.    RESULT
  1432.        One of the following values:
  1433.            W3D_SUCCESS             Operation successful
  1434.            W3D_NOSTENCILBUFFER     No stencil buffer present (either it`s not
  1435.                                        allocated, or not supported)
  1436.            W3D_ILLEGALINPUT        Illegal depth value
  1437.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  1438.                                        the hardware
  1439.  
  1440.    EXAMPLE
  1441.  
  1442.    NOTES
  1443.  
  1444.    BUGS
  1445.  
  1446.    SEE ALSO
  1447.        W3D_CreateStencilBuffer, W3D_ClearStencilBuffer
  1448.  
  1449. Warp3D/W3D_Flush                                                    Warp3D/W3D_Flush
  1450.  
  1451.    NAME   
  1452.        W3D_Flush -- Flush indirect drawing queue
  1453.  
  1454.    SYNOPSIS
  1455.        result = W3D_Flush(context);
  1456.                  a0
  1457.  
  1458.        ULONG W3D_Flush(W3D_Context *);
  1459.  
  1460.    FUNCTION
  1461.        If the given context is not in indirect mode, nothing happens.
  1462.        Otherwise, the internal queue is flushed and all buffered drawing
  1463.        request are drawn.
  1464.  
  1465.    INPUTS
  1466.        context - the context which should be flushed
  1467.  
  1468.    RESULT
  1469.        A value indicating error or success:
  1470.            W3D_SUCCESS     success
  1471.            W3D_NOTVISIBLE  Locking the hardware was unsuccesful
  1472.  
  1473.    EXAMPLE
  1474.  
  1475.    NOTES
  1476.  
  1477.    BUGS
  1478.  
  1479.    SEE ALSO
  1480.        W3D_SetState, W3D_CreateContext, W3D_LockHardware, W3D_UnLockHardware
  1481.  
  1482. Warp3D/W3D_FlushFrame                                          Warp3D/W3D_FlushFrame
  1483.  
  1484.    NAME
  1485.        W3D_FlushFrame -- Flush the current frame
  1486.  
  1487.    SYNOPSIS
  1488.        W3D_FlushFrame(context);
  1489.                          a0
  1490.  
  1491.        void W3D_FlushFrame(W3D_Context*);
  1492.  
  1493.    FUNCTION
  1494.        This function flushes the current frame. It must be called at the end
  1495.        of your drawing when the frame is finished. This function *must* be
  1496.        called by any application, even if you do not "intent" to support
  1497.        CPU drivers (for which this function is mainly designed).
  1498.  
  1499.    INPUTS
  1500.        context -   The context to flush
  1501.  
  1502.    RESULT
  1503.  
  1504.    EXAMPLE
  1505.  
  1506.    NOTES
  1507.        If the context is indirect, this function also flushes the
  1508.        Queue.
  1509.  
  1510.    BUGS
  1511.  
  1512.    SEE ALSO
  1513.  
  1514. Warp3D/W3D_FlushTextures                                    Warp3D/W3D_FlushTextures
  1515.  
  1516.    NAME
  1517.        W3D_FlushTextures -- Release all textures from video ram
  1518.  
  1519.    SYNOPSIS
  1520.        W3D_FlushTextures(context);
  1521.                          a0
  1522.  
  1523.        void W3D_FlushTextures(W3D_Context);
  1524.  
  1525.    FUNCTION
  1526.        This function releases every texture that`s currently
  1527.        on the graphics board`s texture memory.
  1528.  
  1529.    INPUTS
  1530.        context - Pointer to a W3D_Context
  1531.  
  1532.    RESULT
  1533.        None
  1534.  
  1535.    EXAMPLE
  1536.  
  1537.    NOTES
  1538.  
  1539.    BUGS
  1540.  
  1541.    SEE ALSO
  1542.        W3D_ReleaseTexture
  1543.  
  1544. Warp3D/W3D_FreeAllTexObj                                    Warp3D/W3D_FreeAllTexObj
  1545.  
  1546.    NAME
  1547.        W3D_FreeAllTexObj -- Free all textures in context
  1548.  
  1549.    SYNOPSIS
  1550.        W3D_FreeAllTexObj(context);
  1551.                          a0
  1552.  
  1553.        void W3D_FreeTexObj(W3D_Context *);
  1554.  
  1555.    FUNCTION
  1556.        Free all texture objects allocated in the current context.
  1557.  
  1558.    INPUTS
  1559.        context - the pointer to the context
  1560.  
  1561.    RESULT
  1562.  
  1563.    EXAMPLE
  1564.  
  1565.    NOTES
  1566.  
  1567.    BUGS
  1568.  
  1569.    SEE ALSO
  1570.        W3D_FreeTexObj, W3D_AllocTexObj
  1571.  
  1572. Warp3D/W3D_FreeScreenmodeList                          Warp3D/W3D_FreeScreenmodeList
  1573.  
  1574.    NAME
  1575.        W3D_FreeScreenmodeList - Free the list of screen modes (V3)
  1576.  
  1577.    SYNOPSIS
  1578.        void W3D_FreeScreenmodeList(W3D_ScreenMode *);
  1579.  
  1580.        W3D_FreeScreenmodeList(list);
  1581.  
  1582.    FUNCTION
  1583.        Frees all resources that are attached to the Screen Mode list
  1584.        which must have been allocated with W3D_GetScreenmodeList.
  1585.  
  1586.    INPUTS
  1587.        list - the list pointer obtained by W3D_GetScreenmodeList
  1588.  
  1589.    RESULT
  1590.  
  1591.    EXAMPLE
  1592.  
  1593.    NOTES
  1594.  
  1595.    BUGS
  1596.  
  1597.    SEE ALSO
  1598.        W3D_GetScreenmodeList
  1599. Warp3D/W3D_FreeStencilBuffer                            Warp3D/W3D_FreeStencilBuffer
  1600.  
  1601.    NAME
  1602.        W3D_FreeStencilBuffer -- Free the stencil buffer
  1603.  
  1604.    SYNOPSIS
  1605.        success = W3D_FreeStencilBuffer(context);
  1606.        d0                              a0
  1607.  
  1608.        ULONG W3D_FreeStencilBuffer(W3D_Context *);
  1609.  
  1610.    FUNCTION
  1611.        Free up all memory associated with the stencil buffer.
  1612.  
  1613.    INPUTS
  1614.        context - the context containing the stencil buffer to be freed
  1615.  
  1616.    RESULT
  1617.        One of the following values:
  1618.            W3D_SUCCESS             Operation succesful
  1619.            W3D_NOSTENCILBUFFER     No stencil buffer was allocated, or stencil
  1620.                                        buffering is not supported by the current
  1621.                                        hardware driver.
  1622.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  1623.                                        the hardware
  1624.  
  1625.    EXAMPLE
  1626.  
  1627.    NOTES
  1628.  
  1629.    BUGS
  1630.  
  1631.    SEE ALSO
  1632.        W3D_CreateStencilBuffer
  1633.  
  1634. Warp3D/W3D_FreeTexObj                                          Warp3D/W3D_FreeTexObj
  1635.  
  1636.    NAME
  1637.        W3D_FreeTexObj -- Free a texture object
  1638.  
  1639.    SYNOPSIS
  1640.        W3D_FreeTexObj(context, texture);
  1641.                       a0       a1
  1642.  
  1643.        void W3D_FreeTexObj(W3D_Context *, W3D_Texture *);
  1644.  
  1645.    FUNCTION
  1646.        Remove the texture object from the list of textures
  1647.        and free up all resources associated with it.
  1648.  
  1649.    INPUTS
  1650.        context - Pointer to a W3D_Context
  1651.        texture - Pointer to a texture to be released
  1652.  
  1653.    RESULT
  1654.        None
  1655.  
  1656.    EXAMPLE
  1657.        extern W3D_Context *context;
  1658.        void *image = LoadImage("texture.iff");
  1659.        W3D_Texture *texobj;
  1660.        struct TagItem tags[] = {
  1661.            W3D_ATO_IMAGE,      image,
  1662.            W3D_ATO_FORMAT,     W3D_A1R5G5B5,
  1663.            W3D_ATO_WITDH,      128,
  1664.            W3D_ATO_HEIGHT,     128,
  1665.            TAG_DONE,           0
  1666.        };
  1667.        ULONG error;
  1668.  
  1669.        texobj = W3D_AllocTexObj(context, &error, tags);
  1670.        if (!texobj) {
  1671.            printf("An error has occurred because: An error has occurred (%d)\n",
  1672.                        error);
  1673.        } else {
  1674.            ... Draw some cool stuff ...
  1675.            W3D_FreeTexObj(context, texobj);
  1676.  
  1677.  
  1678.    NOTES
  1679.        Free all textures. Even if you can afford the memory loss in main memory,
  1680.        you`ll loose video memory.
  1681.        The `locked` pointers (those to the image and user-defined mipmaps)
  1682.        are now `unlocked`, and may be used again.
  1683.  
  1684.    BUGS
  1685.  
  1686.    SEE ALSO
  1687.        W3D_AllocTexObj
  1688.  
  1689. Warp3D/W3D_FreeZBuffer                                        Warp3D/W3D_FreeZBuffer
  1690.  
  1691.    NAME
  1692.        W3D_FreeZBuffer -- Free ZBuffer
  1693.  
  1694.    SYNOPSIS
  1695.        success = W3D_FreeZBuffer(context);
  1696.        d0                        a0
  1697.  
  1698.        ULONG W3D_FreeZBuffer(W3D_Context *);
  1699.  
  1700.    FUNCTION
  1701.        Free the ZBuffer previously allocated with W3D_AllocZBuffer
  1702.  
  1703.    INPUTS
  1704.        context - Pointer to a W3D_Context
  1705.  
  1706.    RESULT
  1707.        One of the following values:
  1708.            W3D_SUCCESS     Success
  1709.            W3D_NOZBUFFER   No Z Buffer was allocated
  1710.            W3D_NOTVISIBLE  ZBuffer is not visible
  1711.  
  1712.    EXAMPLE
  1713.  
  1714.    NOTES
  1715.  
  1716.    BUGS
  1717.  
  1718.    SEE ALSO
  1719.        W3D_AllocZBuffer
  1720.  
  1721. Warp3D/W3D_GetDestFmt                                          Warp3D/W3D_GetDestFmt
  1722.  
  1723.    NAME
  1724.        W3D_GetDestFmt -- Get information about supported formats
  1725.  
  1726.    SYNOPSIS
  1727.        format = W3D_GetDestFmt();
  1728.        d0
  1729.  
  1730.        ULONG W3D_GetDestFmt(void);
  1731.  
  1732.    FUNCTION
  1733.        *DEPRECATED* DO NOT USE THIS IN NEW PROJECTS
  1734.        This function can be used to get information about the destination
  1735.        (i.e. screen) format supported by the current driver. The result
  1736.        is a bitmask, with each bit representing a supported format.
  1737.        This function can be used before opening a display, to ensure
  1738.        that only a supported display area is selected.
  1739.  
  1740.    INPUTS
  1741.        None
  1742.  
  1743.    RESULT
  1744.        A bitmask representing supported modes. Currently, some of the
  1745.        following bits:
  1746.            W3D_FMT_CLUT
  1747.            W3D_FMT_R5G5B5
  1748.            W3D_FMT_B5G5R5
  1749.            W3D_FMT_R5G5B5PC
  1750.            W3D_FMT_B5G5R5PC
  1751.            W3D_FMT_R5G6B5
  1752.            W3D_FMT_B5G6R5
  1753.            W3D_FMT_R5G6B5PC
  1754.            W3D_FMT_B5G6R5PC
  1755.            W3D_FMT_R8G8B8
  1756.            W3D_FMT_B8G8R8
  1757.            W3D_FMT_A8R8G8B8
  1758.            W3D_FMT_A8B8G8R8
  1759.            W3D_FMT_R8G8B8A8
  1760.            W3D_FMT_B8G8R8A8
  1761.  
  1762.    EXAMPLE
  1763.        ULONG fmt = W3D_GetDestFmt();
  1764.  
  1765.        if (fmt & W3D_FMT_CLUT)     printf("Driver supports 8 bit modes\n");
  1766.        if (fmt & W3D_R5G5B5)       printf("Driver supports 15 bit RGB modes\n");
  1767.  
  1768.    NOTES
  1769.        This function is deprecated and should not be used in future
  1770.        projects.
  1771.  
  1772.    BUGS
  1773.  
  1774.    SEE ALSO
  1775.        W3D_CreateContext, W3D_Query, W3D_GetDrivers
  1776.  
  1777. Warp3D/W3D_GetDrivers                                          Warp3D/W3D_GetDrivers
  1778.  
  1779.    NAME
  1780.        W3D_GetDrivers -- Get the internal list of drivers (V2)
  1781.  
  1782.    SYNOPSIS
  1783.        driverarray = W3D_GetDrivers();
  1784.           D0
  1785.  
  1786.        W3D_Driver **W3D_GetDrivers(void);
  1787.  
  1788.    FUNCTION
  1789.        This function returns a (NULL-Terminated) Array of pointers
  1790.        to W3D_Driver structures. You can use these to find a suitable
  1791.        driver, offer the user a selection of hardware, or activate
  1792.        one driver for further queries.
  1793.  
  1794.    INPUTS
  1795.  
  1796.    RESULT
  1797.        driverarray -   A null-terminated array of pointers to
  1798.                        W3D_Driver structures.
  1799.  
  1800.    EXAMPLE
  1801.  
  1802.    NOTES
  1803.        The returned list is STRICTLY read-only.
  1804.  
  1805.    BUGS
  1806.  
  1807.    SEE ALSO
  1808.        W3D_TestMode
  1809.  
  1810. Warp3D/W3D_GetDriverState                                  Warp3D/W3D_GetDriverState
  1811.  
  1812.    NAME
  1813.        W3D_GetDriverState -- get current state of driver
  1814.  
  1815.    SYNOPSIS
  1816.        result = W3D_GetDriverState(context);
  1817.        d0                          a0
  1818.  
  1819.        ULONG W3D_GetDriverState(W3D_Context *);
  1820.  
  1821.    FUNCTION
  1822.        Return information about the current state of the driver.
  1823.        This function can be used to check if the current driver
  1824.        is able to start rendering now.
  1825.  
  1826.    INPUTS
  1827.        context - The context to check the state for
  1828.  
  1829.    RESULT
  1830.        One of the following values:
  1831.            W3D_SUCCESS         Success, rendering possible
  1832.            W3D_NOTVISIBLE      Drawing area is not currently on
  1833.                                the video card's memory.
  1834.  
  1835.    EXAMPLE
  1836.        if (W3D_SUCCESS == W3D_GetDriverState(context)
  1837.            RenderFrame();
  1838.        else
  1839.            printf("Error: Bitmap not visible, can't render\n");
  1840.  
  1841.    NOTES
  1842.  
  1843.    BUGS
  1844.  
  1845.    SEE ALSO
  1846.        W3D_LockHardware
  1847.  
  1848. Warp3D/W3D_GetDriverTexFmtInfo                        Warp3D/W3D_GetDriverTexFmtInfo
  1849.  
  1850.    NAME
  1851.        W3D_GetDriverTexFmtInfo -- Get information about the texture format (V2)
  1852.  
  1853.    SYNOPSIS
  1854.        info = W3D_GetDriverTexFmtInfo(driver, format, destfmt);
  1855.        d0                               a0       d0      d1
  1856.  
  1857.        ULONG W3D_GetDriverTexInfo(W3D_Driver*, ULONG, ULONG);
  1858.  
  1859.    FUNCTION
  1860.        This function is used to get information about the texture
  1861.        format, i.e. if it`s directly supported by the hardware,
  1862.        or must be converted in some way. Contrary to the similar
  1863.        function W3d_GetTexFmtInfo, this function does not need a
  1864.        context to operate, but can be used to query individual drivers
  1865.        about their texture format capabilities.
  1866.  
  1867.    INPUTS
  1868.        driver  - A pointer to a W3D_Driver structure
  1869.        texfmt  - The texture format to be queried. Currently,
  1870.                  one of the following:
  1871.                    W3D_CHUNKY           palettized
  1872.                    W3D_A1R5G5B5         a rrrrr ggggg bbbbb
  1873.                    W3D_R5G6B5           rrrrr gggggg bbbbb
  1874.                    W3D_R8G8B8           rrrrrrrr gggggggg bbbbbbbb
  1875.                    W3D_A4R4G4B4         aaaa rrrr gggg bbbb
  1876.                    W3D_A8R8G8B8         aaaaaaaa rrrrrrrr gggggggg bbbbbbbb
  1877.                    W3D_R8G8B8A8         rrrrrrrr gggggggg bbbbbbbb aaaaaaaa
  1878.                    W3D_A8               aaaaaaaa
  1879.                    W3D_L8               llllllll
  1880.                    W3D_L8A8             llllllll aaaaaaaa
  1881.                    W3D_I8               iiiiiiii
  1882.                  See the main documentation for more information.
  1883.        destfmt - The destination screen format.
  1884.  
  1885.    RESULT
  1886.        A bitvector with the following bits
  1887.            W3D_TEXFMT_FAST         Format directly supported by HW
  1888.            W3D_TEXFMT_CLUTFAST     Format directly supported in CLUT modes only
  1889.            W3D_TEXFMT_ARGBFAST     Format directly supported in direct color
  1890.                                        modes only
  1891.            W3D_TEXFMT_UNSUPPORTED  Format not supported, and can't be emulated
  1892.            W3D_TEXFMT_SUPPORTED    Format is supported, although it may be
  1893.                                        internally converted
  1894.  
  1895.    EXAMPLE
  1896.  
  1897.    NOTES
  1898.        Formats that are not directly supported can still be used for textures.
  1899.        Note, however, that those textures must be converted.
  1900.  
  1901.    BUGS
  1902.  
  1903.    SEE ALSO
  1904.        W3D_GetTexFmtInfo()
  1905.  
  1906. Warp3D/W3D_GetScreenmodeList                            Warp3D/W3D_GetScreenmodeList
  1907.  
  1908.    NAME
  1909.        W3D_GetScreenmodeList - Return a list of screen modes (V3)
  1910.  
  1911.    SYNOPSIS
  1912.        W3D_ScreenMode *W3D_GetScreenmodeList(void)
  1913.  
  1914.        list = W3D_GetScreenmodeList();
  1915.  
  1916.    FUNCTION
  1917.        Returns a list of W3D_ScreenMode structures that represent
  1918.        all modes that are usable by Warp3D's drivers.
  1919.  
  1920.        The result is read-only, step through the list by examining
  1921.        the 'Next' field until this is NULL.
  1922.  
  1923.    INPUTS
  1924.        None
  1925.  
  1926.    RESULT
  1927.        list - A pointer to the first W3D_ScreenMode entry or NULL
  1928.               if no screenmode was found
  1929.  
  1930.    EXAMPLE
  1931.  
  1932.    NOTES
  1933.        This function also returns screenmodes which are only usable
  1934.        by software drivers. You should examine the Driver field to
  1935.        find a mode that matches your desired driver.
  1936.  
  1937.        You MUST free this list with W3D_FreeScreenmodeList
  1938.  
  1939.    BUGS
  1940.  
  1941.    SEE ALSO
  1942.        W3D_FreeScreenmodeList
  1943. Warp3D/W3D_GetState                                              Warp3D/W3D_GetState
  1944.  
  1945.    NAME
  1946.        W3D_GetState -- Get current state of hardware/context
  1947.  
  1948.    SYNOPSIS
  1949.        result = W3D_GetState(context, state);
  1950.        d0                    a0       d0
  1951.  
  1952.        ULONG W3D_GetState(W3D_Context *, ULONG);
  1953.  
  1954.    FUNCTION
  1955.        This function reads the state of the bits in the
  1956.        state field of the context structure.
  1957.  
  1958.    INPUTS
  1959.        context - pointer to a Warp3D context
  1960.        state   - The bit that is tested. Currently, this may
  1961.                  be one of the following:
  1962.                      W3D_AUTOTEXMANAGEMENT  automatic texture management
  1963.                      W3D_SYNCHRON           wait, until HW is idle
  1964.                      W3D_INDIRECT           buffer drawings until W3D_Flush()'ed
  1965.                      W3D_GLOBALTEXENV       global texture modes
  1966.                      W3D_DOUBLEHEIGHT       screen has double height.
  1967.                      W3D_FAST               Drawing functions may modify passed stru
  1968. ctures
  1969.                      W3D_TEXMAPPING         texmapping state
  1970.                      W3D_PERSPECTIVE        perspective correction state
  1971.                      W3D_GOURAUD            gouraud/flat shading
  1972.                      W3D_ZBUFFER            Z-Buffer state
  1973.                      W3D_ZBUFFERUPDATE      Z-Buffer update state
  1974.                      W3D_BLENDING           Alpha blending state
  1975.                      W3D_FOGGING            Fogging state
  1976.                      W3D_ANTI_POINT         Point antialiasing
  1977.                      W3D_ANTI_LINE          Line antialiasing
  1978.                      W3D_ANTI_POLYGON       Polygon antialiasing
  1979.                      W3D_ANTI_FULLSCREEN    Fullscreen antialiasing
  1980.                      W3D_DITHERING          dithering state
  1981.                      W3D_LOGICOP            logical operations state
  1982.                      W3D_STENCILBUFFER      stencil buffer state
  1983.                      W3D_ALPHATEST          Alpha test state
  1984.                      W3D_SPECULAR           Specular highlightung state
  1985.                      W3D_TEXMAPPING3D       3D texturemapping state
  1986.                             W3D_CHROMATEST        Chroma test (color keying)
  1987.  
  1988.    RESULT
  1989.        One of the following:
  1990.            W3D_ENABLED     the mode is enabled
  1991.            W3D_DISABLED    the mode is disabled/not available
  1992.  
  1993.    EXAMPLE
  1994.        if (W3D_ENABLED == W3D_GetState(context, W3D_FOGGING)) {
  1995.            printf("Gee, I can`t see in all this fog\n");
  1996.        } else {
  1997.            printf("Aha, that`s better\n");
  1998.        }
  1999.  
  2000.    NOTES
  2001.         Don't use W3D_SYNCHRON, this state might only be useful for
  2002.         debugging purposes.
  2003.  
  2004.         The W3D_FAST mode can speed up your application, always use it,
  2005.         if you don't care what happens to the values in the drawing
  2006.         structures (like W3D_Triangle, W3D_Line etc.)
  2007.  
  2008.         'Indirect drawing' has the advantage, that the 'locking' time
  2009.         is minimized, please provide at least an option for the user to
  2010.         use it.
  2011.  
  2012.         For more information about the different states, please refer
  2013.         to the Warp3D Programmer Documentation.
  2014.  
  2015.    BUGS
  2016.  
  2017.    SEE ALSO
  2018.        W3D_SetState
  2019.  
  2020. Warp3D/W3D_GetTexFmtInfo                                    Warp3D/W3D_GetTexFmtInfo
  2021.  
  2022.    NAME
  2023.        W3D_GetTexFmtInfo -- Get information about the texture format
  2024.  
  2025.    SYNOPSIS
  2026.        info = W3D_GetTexFmtInfo(context, format, destfmt);
  2027.        d0                       a0       d0      d1
  2028.  
  2029.        ULONG W3D_GetTexInfo(W3D_Context, ULONG, ULONG);
  2030.  
  2031.    FUNCTION
  2032.        This function is used to get information about the texture
  2033.        format, i.e. if it`s directly supported by the hardware,
  2034.        or must be converted in some way.
  2035.  
  2036.    INPUTS
  2037.        context - A valid context pointer
  2038.        texfmt  - The texture format to be queried. Currently,
  2039.                  one of the following:
  2040.                    W3D_CHUNKY           palettized
  2041.                    W3D_A1R5G5B5         a rrrrr ggggg bbbbb
  2042.                    W3D_R5G6B5           rrrrr gggggg bbbbb
  2043.                    W3D_R8G8B8           rrrrrrrr gggggggg bbbbbbbb
  2044.                    W3D_A4R4G4B4         aaaa rrrr gggg bbbb
  2045.                    W3D_A8R8G8B8         aaaaaaaa rrrrrrrr gggggggg bbbbbbbb
  2046.                    W3D_R8G8B8A8         rrrrrrrr gggggggg bbbbbbbb aaaaaaaa
  2047.                    W3D_A8               aaaaaaaa
  2048.                    W3D_L8               llllllll
  2049.                    W3D_L8A8             llllllll aaaaaaaa
  2050.                    W3D_I8               iiiiiiii
  2051.                  See the main documentation for more information.
  2052.        destfmt - The destination screen format.
  2053.  
  2054.    RESULT
  2055.        A bitvector with the following bits
  2056.            W3D_TEXFMT_FAST         Format directly supported by HW
  2057.            W3D_TEXFMT_CLUTFAST     Format directly supported in CLUT modes only
  2058.            W3D_TEXFMT_ARGBFAST     Format directly supported in direct color
  2059.                                        modes only
  2060.            W3D_TEXFMT_UNSUPPORTED  Format not supported, and can't be emulated
  2061.            W3D_TEXFMT_SUPPORTED    Format is supported, although it may be
  2062.                                        internally converted
  2063.  
  2064.    EXAMPLE
  2065.        ULONG info = W3D_GetTexFmtInfo(NULL, W3D_CHUNKY, W3D_FMT_CLUT);
  2066.        if (info & W3D_TEXFMT_CLUTFAST) printf("Supported in CLUT modes\n");
  2067.  
  2068.    NOTES
  2069.        Formats that are not directly supported can still be used for textures.
  2070.        Note, however, that those textures must be converted.
  2071.  
  2072.        IMPORTANT: Prior to Version 2 of the API, this function could be
  2073.        called with a NULL context to query the default driver. Although this
  2074.        is still possible for backward compatibility reasons, a programmer
  2075.        must not use this feature in new projects, but rather use the new and
  2076.        improved W3D_GetDriverTexFmtInfo() function instead, which is essential
  2077.        for multiple driver support. You may still call this function with a
  2078.        valid context, of course.
  2079.  
  2080.    BUGS
  2081.  
  2082.    SEE ALSO
  2083.        W3D_GetDriverTexFmtInfo()
  2084.  
  2085. Warp3D/W3D_Hint                                                      Warp3D/W3D_Hint
  2086.  
  2087.    NAME
  2088.        W3D_Hint -- Hint about rendering quality
  2089.  
  2090.    SYNOPSIS
  2091.        result = W3D_Hint(context, mode, quality);
  2092.        d0                a0       d0    d1
  2093.  
  2094.        ULONG W3D_Hint(W3D_Context, ULONG, ULONG);
  2095.  
  2096.    FUNCTION
  2097.        Gives Warp3D a hint about the desired quality of some
  2098.        effects. This can be used to improve rendering speed
  2099.        at the cost of display quality.
  2100.  
  2101.    INPUTS
  2102.        context - The context to hint for
  2103.        mode    - The mode to hint for. One of the following values
  2104.                    W3D_H_TEXMAPPING      - quality of general texmapping
  2105.                    W3D_H_MIPMAPPING      - quality of mipmapping
  2106.                    W3D_H_BILINEARFILTER  - quality of bilinear filtering
  2107.                    W3D_H_MMFILTER        - quality of depth filter
  2108.                    W3D_H_PERSPECTIVE     - quality of perspective correction
  2109.                    W3D_H_BLENDING        - quality of alpha blending
  2110.                    W3D_H_FOGGING         - quality of fogging
  2111.                    W3D_H_ANTIALIASING    - quality of antialiasing
  2112.                    W3D_H_DITHERING       - quality of dithering
  2113.                    W3D_H_ZBUFFER         - quality of ZBuffering
  2114.        quality - The desired quality. Possible  values are
  2115.                    W3D_H_FAST            - fast, low quality
  2116.                    W3D_H_AVERAGE         - average speed, average quality
  2117.                    W3D_H_NICE            - low speed, high quality
  2118.  
  2119.  
  2120.    RESULT
  2121.        A value indicating success or failure:
  2122.            W3D_SUCCESS         Success
  2123.            W3D_ILLEGALINPUT    Failure, illegal input
  2124.  
  2125.    EXAMPLE
  2126.  
  2127.    NOTES
  2128.        This function only gives hints to Warp3D. It is possible
  2129.        that it doesn't do anything at all, depending on the
  2130.        possibility the hardware or driver offers.
  2131.  
  2132.    BUGS
  2133.        The ViRGE driver selects it`s filter modes when they are set
  2134.        with W3D_SetFilter, so you have to set the filter modes again
  2135.        when messing with the W3D_H_BILINEARFILTER setting.
  2136.  
  2137.    SEE ALSO
  2138.  
  2139. Warp3D/W3D_LockHardware                                      Warp3D/W3D_LockHardware
  2140.  
  2141.    NAME
  2142.        W3D_LockHardware -- Gain exclusive hardware access
  2143.  
  2144.    SYNOPSIS
  2145.        res = W3D_LockHardware(context);
  2146.        d0                     a0
  2147.  
  2148.        ULONG W3D_LockHardware(W3D_Context *);
  2149.  
  2150.    FUNCTION
  2151.        This function gains exclusive access to the hardware. It must be
  2152.        called whenever objects are drawn, except when operating in 'indirect
  2153.        render' mode. You should not lock the frame too long, because the
  2154.        system is freezed in locked state.
  2155.  
  2156.    INPUTS
  2157.        context - a pointer to a W3D_Context structure
  2158.  
  2159.    RESULT
  2160.        A value indication success or failure:
  2161.            W3D_SUCCESS     - The hardware is locked
  2162.            W3D_NOTVISIBLE  - The bitmap is not visible/swapped out of vmem
  2163.  
  2164.    EXAMPLE
  2165.        if (W3D_SUCCESS == W3D_LockHardware(context) {
  2166.            ...
  2167.            Render some stuff
  2168.            ...
  2169.            W3D_UnLockHardware(context);
  2170.        } else {
  2171.            printf("Can`t lock hardware\n");
  2172.        }
  2173.  
  2174.    NOTES
  2175.        This function may forbid multitasking (depending on the driver),
  2176.        or even disable interrupts.
  2177.  
  2178.    BUGS
  2179.  
  2180.    SEE ALSO
  2181.        W3D_UnLockHardware, W3D_SetState
  2182.  
  2183. Warp3D/W3D_Query                                                    Warp3D/W3D_Query
  2184.  
  2185.    NAME
  2186.        W3D_Query -- Query capabilities of the driver
  2187.  
  2188.    SYNOPSIS
  2189.        res = W3D_Query(context, query, destfmt)
  2190.        d0              a0       d0     d1
  2191.  
  2192.        ULONG W3D_Query(W3D_Context *, ULONG, ULONG);
  2193.  
  2194.    FUNCTION
  2195.        This function is used to query the hardware/driver
  2196.        capabilities. It takes destination formats into account
  2197.        (checking compatibility).
  2198.  
  2199.    INPUTS
  2200.        context     - pointer to a W3D_Context
  2201.        query       - a value to be queried.
  2202.                      Currently, the following values are supported:
  2203.                        W3D_Q_DRAW_POINT         point drawing
  2204.                        W3D_Q_DRAW_LINE          line drawing
  2205.                        W3D_Q_DRAW_TRIANGLE      triangle drawing
  2206.                        W3D_Q_DRAW_POINT_X       points with size != 1 supported
  2207.                        W3D_Q_DRAW_LINE_X        lines with width != 1 supported
  2208.                        W3D_Q_DRAW_LINE_ST       line stippling supported
  2209.                        W3D_Q_DRAW_POLY_ST       polygon stippling supported
  2210.                        W3D_Q_TEXMAPPING         texmapping in general
  2211.                        W3D_Q_MIPMAPPING         mipmapping
  2212.                        W3D_Q_BILINEARFILTER     bilinear filter
  2213.                        W3D_Q_MMFILTER           mipmap filter
  2214.                        W3D_Q_LINEAR_REPEAT      W3D_REPEAT for linear texmapping
  2215.                        W3D_Q_LINEAR_CLAMP       W3D_CLAMP for linear texmapping
  2216.                        W3D_Q_PERPESCTIVE        perspective correction
  2217.                        W3D_Q_PERSP_REPEAT       W3D_REPEAT for persp. texmapping
  2218.                        W3D_Q_PERSP_CLAMP        W3D_CLAMP for persp. texmapping
  2219.                        W3D_Q_ENV_REPLACE        texenv REPLACE
  2220.                        W3D_Q_ENV_DECAL          texenv DECAL
  2221.                        W3D_Q_ENV_MODULATE       texenv MODULATE
  2222.                        W3D_Q_ENV_BLEND          texenv BLEND
  2223.                        W3D_Q_FLATSHADING        flat shading
  2224.                        W3D_Q_GOURAUDSHADING     gouraud shading
  2225.                        W3D_Q_ZBUFFER            Z buffer in general
  2226.                        W3D_Q_ZBUFFERUPDATE      Z buffer update
  2227.                        W3D_Q_ZCOMPAREMODES      Z buffer compare modes
  2228.                        W3D_Q_ALPHATEST          alpha test in general
  2229.                        W3D_Q_ALPHATESTMODES     alpha test modes
  2230.                        W3D_Q_BLENDING           alpha blending
  2231.                        W3D_Q_SRCFACTORS         source factors
  2232.                        W3D_Q_DESTFACTORS        destination factors
  2233.                        W3D_Q_FOGGING            fogging in general
  2234.                        W3D_Q_LINEAR             linear fogging
  2235.                        W3D_Q_EXPONENTIAL        exponential fogging
  2236.                        W3D_Q_S_EXPONENTIAL      square exponential fogging
  2237.                        W3D_Q_ANTIALIASING       antialiasing in general
  2238.                        W3D_Q_ANTI_POINT         point antialiasing
  2239.                        W3D_Q_ANTI_LINE          line antialiasing
  2240.                        W3D_Q_ANTI_POLYGON       polygon antialiasing
  2241.                        W3D_Q_ANTI_FULLSCREEN    fullscreen antialiasing
  2242.                        W3D_Q_DITHERING          dithering
  2243.                        W3D_Q_SCISSOR            scissor test
  2244.                        W3D_Q_MAXTEXWIDTH        max. texture width
  2245.                        W3D_Q_MAXTEXHEIGHT       max. texture height
  2246.                        W3D_Q_RECTTEXTURES       rectangular textures
  2247.                        W3D_Q_LOGICOP            logical operations
  2248.                        W3D_Q_MASKING            color/index masking
  2249.                        W3D_Q_STENCILBUFFER      stencil buffer in general
  2250.                        W3D_Q_STENCIL_MASK       mask value
  2251.                        W3D_Q_STENCIL_FUNC       stencil functions
  2252.                        W3D_Q_STENCIL_SFAIL      stencil operation SFAIL
  2253.                        W3D_Q_STENCIL_DPFAIL     stencil operation DPFAIL
  2254.                        W3D_Q_STENCIL_DPPASS     stencil operation DPPASS
  2255.                        W3D_Q_STENCIL_WRMASK     stencil buffer supports write maskin
  2256. g
  2257.                        W3D_Q_PALETTECONV        driver can use texture with a pallet
  2258. te
  2259.                                                    other than the screen palette on
  2260.                                                    8 bit screens
  2261.                        W3D_Q_DRAW_POINT_FX     driver supports point fx (fog, zbuffe
  2262. r)
  2263.                        W3D_Q_DRAW_POINT_TEX    driver supports points textured
  2264.                        W3D_Q_DRAW_LINE_FX      driver supports line fx
  2265.                        W3D_Q_DRAW_LINE_TEX     driver supports textured lines
  2266.                        W3D_Q_SPECULAR          driver supports specular reflection
  2267.                        W3D_Q_CULLFACE          driver supports culling of faces
  2268.        destfmt     - The destination format
  2269.  
  2270.    RESULT
  2271.        Depends on the item. With most of the "is this supported"-type
  2272.        queries, one of the following constants is returned:
  2273.            W3D_FULLY_SUPPORTED     Completely supported by driver
  2274.            W3D_PARTIALLY_SUPPORTED Only partially supported
  2275.            W3D_NOT_SUPPORTED       Not supported
  2276.  
  2277.        With "what is the value"-type queries like W3D_Q_MAXTEXWIDTH,
  2278.        an ULONG is returned.
  2279.  
  2280.    EXAMPLE
  2281.        switch(W3D_Query(context, W3D_Q_TEXMAPING, destfmt)) {
  2282.        case W3D_FULLY_SUPPORTED:     printf("Completely supported by driver\n");
  2283.                                      break;
  2284.        case W3D_PARTIALLY_SUPPORTED: printf("Only partially supported\n");
  2285.                                      break;
  2286.        case W3D_NOT_SUPPORTED:       printf("Not supported\n");
  2287.                                      break;
  2288.        }
  2289.  
  2290.    NOTES
  2291.        Regarding chunky/ARGB combinations:
  2292.        You are advised that you always use chunky textures with chunky
  2293.        screens only, and ARGB textures with ARGB screens
  2294.  
  2295.        IMPORTANT: Prior to Version 2 of the API, the W3D_Query function
  2296.        could be called with a NULL pointer instead of a context. Although
  2297.        this possibility is still supported for backward compatibility,
  2298.        the programmer is strictly encouraged to use the new W3D_QueryDriver
  2299.        function instead. The W3D_QueryDriver function may be used to directly
  2300.        query a specific driver for capabilities, which is essential when
  2301.        working with V2+ and multiple drivers.
  2302.  
  2303.    BUGS
  2304.  
  2305.    SEE ALSO
  2306.        W3D_QueryDriver()
  2307.  
  2308. Warp3D/W3D_QueryDriver                                        Warp3D/W3D_QueryDriver
  2309.  
  2310.    NAME
  2311.        W3D_QueryDriver -- Query capabilities of any driver (V2)
  2312.  
  2313.    SYNOPSIS
  2314.        res = W3D_QueryDriver(driver, query, destfmt)
  2315.        d0                    a0       d0     d1
  2316.  
  2317.        ULONG W3D_QueryDriver(W3D_Driver *, ULONG, ULONG);
  2318.  
  2319.    FUNCTION
  2320.        This function is similar to the W3D_Query function, only
  2321.        that it does not require a context but rather operates on
  2322.        a driver obtained by W3D_GetDrivers().
  2323.  
  2324.    INPUTS
  2325.        driver  -   A pointer to a W3D_Driver structure obtained by
  2326.                    W3D_GetDrivers()
  2327.        query   -   The data item to be queried. See W3D_Query() for
  2328.                    a list of available query items.
  2329.        destfmt -   The destination format you intend to use.
  2330.  
  2331.    RESULT
  2332.        One of the following values is returned:
  2333.            W3D_FULLY_SUPPORTED     Completely supported by driver
  2334.            W3D_PARTIALLY_SUPPORTED Only partially supported
  2335.            W3D_NOT_SUPPORTED       Not supported
  2336.  
  2337.    EXAMPLE
  2338.  
  2339.    NOTES
  2340.  
  2341.    BUGS
  2342.  
  2343.    SEE ALSO
  2344.        W3D_Query(), W3D_GetDrivers()
  2345.  
  2346. Warp3D/W3D_ReadStencilPixel                              Warp3D/W3D_ReadStencilPixel
  2347.  
  2348.    NAME
  2349.        W3D_ReadStencilPixel -- Read a pixel from the stencil buffer
  2350.  
  2351.    SYNOPSIS
  2352.        success = W3D_ReadStencilPixel(context, x, y, st);
  2353.        d0                             a0       d0 d1 a1
  2354.  
  2355.        ULONG W3D_ReadStencilPixel(W3D_Context *, ULONG, ULONG, ULONG *);
  2356.  
  2357.    FUNCTION
  2358.        Read the stencil buffer pixel at x,y into the variable pointed
  2359.        to by st.
  2360.        This function may only be used while the hardware is locked,
  2361.        except when indirect drawing is used.
  2362.  
  2363.    INPUTS
  2364.        context - The context to use
  2365.        x,y     - Coordinates of point
  2366.        st      - Pointer to a variable to hold the read pixel
  2367.  
  2368.    RESULT
  2369.        One of the following values:
  2370.            W3D_SUCCESS         Operation successful
  2371.            W3D_NOSTENCILBUFFER No stencil buffer present
  2372.            W3D_NOTVISIBLE      The stencil buffer can not be accessed by
  2373.                                    the hardware
  2374.            W3D_NOTVISIBLE      Indirect mode only. Locking failed.
  2375.  
  2376.    EXAMPLE
  2377.  
  2378.    NOTES
  2379.         This function is primarly intended for OpenGL implementations,
  2380.         which might need access to the stencil buffer. This function
  2381.         is slow and should normally not be called.
  2382.  
  2383.         Important note: In indirect mode you have to make sure, that
  2384.         the stencil buffer is up to date, no Flush is internally done
  2385.         by this function. You have to call W3D_Flush, if the stencil
  2386.         buffer is not up to date yet.
  2387.  
  2388.    BUGS
  2389.         Indirect mode: the hardware is internally not locked for
  2390.         performance reasons, therefore the result might be wrong, if
  2391.         the corresponding buffer is swapped out.
  2392.  
  2393.    SEE ALSO
  2394.        W3D_ReadStencilSpan
  2395.  
  2396. Warp3D/W3D_ReadStencilSpan                                Warp3D/W3D_ReadStencilSpan
  2397.  
  2398.    NAME
  2399.        W3D_ReadStencilSpan -- Read a range of stencil buffer pixels
  2400.  
  2401.    SYNOPSIS
  2402.        success = W3D_ReadStencilSpan(context, x, y, n, st);
  2403.        d0                            a0       d0 d1 d2 a1
  2404.  
  2405.        ULONG W3D_ReadStencilSpan(W3D_Context *, ULONG, ULONG, ULONG,
  2406.                     ULONG []);
  2407.  
  2408.    FUNCTION
  2409.        Read a span of pixel value from the stencil buffer. The resulting
  2410.        pixels are put into the memory area pointed to by st.
  2411.        This function may only be used while the hardware is locked,
  2412.        except when indirect drawing is used.
  2413.  
  2414.    INPUTS
  2415.        context - The context
  2416.        x,y     - Coordinates of span start
  2417.        n       - Number of pixels to read
  2418.        st      - pointer to the array to hold the pixel
  2419.  
  2420.    RESULT
  2421.        One of the following values:
  2422.            W3D_SUCCESS             Operation successful
  2423.            W3D_NOSTENCILBUFFER     No stencil buffer found
  2424.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  2425.                                        the hardware
  2426.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2427.  
  2428.    EXAMPLE
  2429.  
  2430.    NOTES
  2431.         If you need to read more than one consecutive pixel, use this
  2432.         function instead of calling the single pixel version repeatedly.
  2433.  
  2434.         This function is primarly intended for OpenGL implementations,
  2435.         which might need access to the stencil buffer. This function
  2436.         is slow and should normally not be called.
  2437.  
  2438.         Important note: In indirect mode you have to make sure, that
  2439.         the stencil buffer is up to date, no Flush is internally done
  2440.         by this function. You have to call W3D_Flush, if the stencil
  2441.         buffer is not up to date yet.
  2442.  
  2443.    BUGS
  2444.         Indirect mode: the hardware is internally not locked for
  2445.         performance reasons, therefore the result might be wrong, if
  2446.         the corresponding buffer is swapped out.
  2447.  
  2448.    SEE ALSO
  2449.        W3D_ReadStencilPixel
  2450.  
  2451. Warp3D/W3D_ReadZPixel                                          Warp3D/W3D_ReadZPixel
  2452.  
  2453.    NAME
  2454.        W3D_ReadZPixel -- Read a pixel value from the ZBuffer
  2455.  
  2456.    SYNOPSIS
  2457.        success = W3D_ReadZPixel(context, x, y, z);
  2458.        d0                       a0       d0 d1 a1
  2459.  
  2460.        ULONG W3D_ReadZPixel(W3D_Context *, ULONG, ULONG, W3D_Double *);
  2461.  
  2462.    FUNCTION
  2463.        Read ZBuffer pixel x,y into variable pointed to by z;
  2464.        This function may only be used while the hardware is locked,
  2465.        except when indirect drawing is used.
  2466.  
  2467.    INPUTS
  2468.        context - pointer to the context
  2469.        x,y     - coordinates of pixel
  2470.        z       - pointer to a W3D_Double
  2471.  
  2472.    RESULT
  2473.        One of the following:
  2474.            W3D_SUCCESS     Successful operation
  2475.            W3D_NOZBUFFER   No ZBuffer was allocated
  2476.            W3D_NOTVISIBLE  ZBuffer is not visible
  2477.  
  2478.    EXAMPLE
  2479.  
  2480.    NOTES
  2481.        This function is primarly intended for OpenGL implementations,
  2482.        which might need access to the Z buffer. This function
  2483.        is slow and should normally not be called.
  2484.  
  2485.        * IMPORTANT NOTE: *
  2486.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  2487.        To use this call with indirect mode, you have to manually W3D_Flush,
  2488.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  2489.  
  2490.    BUGS
  2491.        Indirect mode: the hardware is internally not locked for
  2492.        performance reasons, therefore the result might be wrong, if
  2493.        the corresponding buffer is swapped out.
  2494.  
  2495.    SEE ALSO
  2496.        W3D_ReadZSpan
  2497.  
  2498. Warp3D/W3D_ReadZSpan                                            Warp3D/W3D_ReadZSpan
  2499.  
  2500.    NAME
  2501.        W3D_ReadZSpan -- read a range of ZBuffer pixels
  2502.  
  2503.    SYNOPSIS
  2504.        success = W3D_ReadZSpan(context, x, y, n, z);
  2505.        d0                      a0       d0 d1 d2 a1
  2506.  
  2507.        ULONG W3D_ReadZSpan(W3D_Context *, ULONG, ULONG, ULONG, W3D_Double []);
  2508.  
  2509.    FUNCTION
  2510.        Read a span of ZBuffer pixels into an array pointed to by the z
  2511.        parameter.
  2512.        This function may only be used while the hardware is locked,
  2513.        except when indirect drawing is used.
  2514.  
  2515.    INPUTS
  2516.        context - Pointer to the context
  2517.        x,y     - Coordinates of pixels
  2518.        n       - Number of pixels to read
  2519.        z       - Array of W3D_Double to fill. Note that the array must
  2520.                  be large enough (i.e. at least n)
  2521.  
  2522.    RESULT
  2523.        One of the following values
  2524.            W3D_SUCCESS     Operation successful
  2525.            W3D_NOZBUFFER   No ZBuffer was allocated
  2526.            W3D_NOTVISIBLE  ZBuffer is not visible
  2527.  
  2528.    EXAMPLE
  2529.  
  2530.    NOTES
  2531.        You should use this function instead of W3D_ReadZPixel if you`re
  2532.        going to read more pixels than just one.
  2533.  
  2534.        This function is primarly intended for OpenGL implementations,
  2535.        which might need access to the Z buffer. This function
  2536.        is slow and should normally not be called.
  2537.  
  2538.        * IMPORTANT NOTE: *
  2539.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  2540.        To use this call with indirect mode, you have to manually W3D_Flush,
  2541.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  2542.  
  2543.    BUGS
  2544.        Indirect mode: the hardware is internally not locked for
  2545.        performance reasons, therefore the result might be wrong, if
  2546.        the corresponding buffer is swapped out.
  2547.  
  2548.  
  2549.    SEE ALSO
  2550.        W3D_ReadZPixel
  2551.  
  2552. Warp3D/W3D_ReleaseTexture                                  Warp3D/W3D_ReleaseTexture
  2553.  
  2554.    NAME
  2555.        W3D_ReleaseTexture -- Release texture from video ram
  2556.  
  2557.    SYNOPSIS
  2558.        W3D_ReleaseTexture(context, texture);
  2559.                           a0       a1
  2560.  
  2561.        void W3D_ReleaseTexture(W3D_Context *, W3D_Texture *);
  2562.  
  2563.    FUNCTION
  2564.        Release a texture from video ram. This frees the memory
  2565.        allocated by that texture.
  2566.  
  2567.    INPUTS
  2568.        context - Pointer to a W3D_Context
  2569.        texture - Pointer to the texture to be released
  2570.  
  2571.    RESULT
  2572.        None
  2573.  
  2574.    EXAMPLE
  2575.        extern W3D_Texture *texture;
  2576.        extern W3D_Context *context;
  2577.        W3D_ReleaseTexture(context, texture);
  2578.  
  2579.    NOTES
  2580.        This call does nothing if W3D_AUTOTEXMANAGEMENT is set
  2581.        in the context`s state.
  2582.  
  2583.    BUGS
  2584.  
  2585.    SEE ALSO
  2586.        W3D_UploadTexture
  2587.  
  2588. Warp3D/W3D_RequestMode                                        Warp3D/W3D_RequestMode
  2589.  
  2590.    NAME
  2591.        W3D_RequestMode -- Request a screen mode (V2)
  2592.  
  2593.    SYNOPSIS
  2594.        ModeID = W3D_RequestMode(taglist);
  2595.           D0                     a0
  2596.  
  2597.        ULONG W3D_RequestMode(struct TagItem *);
  2598.  
  2599.    FUNCTION
  2600.        This function presents the user with an ASL-Type screen mode
  2601.        requester. The mode requester will only include those screen modes
  2602.        that are supported by the specified combination of tag items.
  2603.  
  2604.    INPUTS
  2605.        taglist - A taglist of W3D_SMR_#? items. The following items
  2606.                  are defined:
  2607.            W3D_SMR_SIZEFILTER (BOOL)
  2608.                If set to TRUE, filter ASLSM_MinWidth, ASLSM_MinHeight,
  2609.                ASLSM_MaxWidth, ASL_MaxHeight
  2610.            W3D_SMR_DRIVER (W3D_Driver *)
  2611.                A pointer to a W3D_Driver structure that you want to use.
  2612.                If this tag is specified, the screen modes in the
  2613.                requester will all be compatible with this driver.
  2614.            W3D_SMR_DESTFMT (W3D_FMT_#? constants)
  2615.                The screen/bitmap formats you want to use. If this tag
  2616.                is active, all screenmodes will be filtered accordingly.
  2617.                You may specify a bitmask to get more than one format.
  2618.            W3D_SMR_TYPE (W3D_DRIVER_3DHW/W3D_DRIVER_CPU)
  2619.                Specifies if you want to filter the screen modes according
  2620.                to the driver type. If this is set to W3D_DRIVER_CPU,
  2621.                only the active CPU driver is used for filtering. Otherwise,
  2622.                all modes of all hardware is filtered, unless the W3D_SMR_DRIVER
  2623.                tag specifies a special driver.
  2624.            ASLSM_???
  2625.                You may give an arbitrary number of ASLSM_#? tags that will be
  2626.                passed to asl.library. Most notably, these include those tags
  2627.                the localize the requester or modify the look, including position
  2628.                and size. Most notably, the ASLSM_Min#? and ASLSM_Max#? tags
  2629.                may be used in a special meaning if the W3D_SMR_SIZEFILTER
  2630.                tag item is present and set to TRUE.
  2631.  
  2632.            Not all of the combinations make sense, for example, specifiying
  2633.            W3D_SMR_TYPE together with W3D_SMR_DRIVER.
  2634.  
  2635.    RESULT
  2636.        ModeID  -   The ModeID the user selected, or INVALID_ID if the requester
  2637.                    was cancelled.
  2638.  
  2639.    EXAMPLE
  2640.  
  2641.    NOTES
  2642.  
  2643.    BUGS
  2644.  
  2645.    SEE ALSO
  2646.        W3D_SelectDriver()
  2647.  
  2648. Warp3D/W3D_SetAlphaMode                                      Warp3D/W3D_SetAlphaMode
  2649.  
  2650.    NAME
  2651.        W3D_SetAlpha -- Set the alpha test mode
  2652.  
  2653.    SYNOPSIS
  2654.        success = W3D_SetAlphaMode(context, mode, refval);
  2655.        d0                         a0       d1    a1
  2656.  
  2657.        ULONG W3D_SetAlphaMode(W3D_Context, ULONG, W3D_Float *);
  2658.  
  2659.    FUNCTION
  2660.        This function defines the way the alpha test is performed.
  2661.        This test compares the incoming pixel's alpha value
  2662.        with the reference value, and decides, depending on the set
  2663.        mode, if the pixel is discarded or not.
  2664.  
  2665.    INPUTS
  2666.        context  - The context
  2667.        mode     - The alpha test mode. One of the following:
  2668.                   W3D_A_NEVER       Always discard
  2669.                   W3D_A_LESS        Draw, if value < refvalue
  2670.                   W3D_A_GEQUAL      Draw, if value >= refvalue
  2671.                   W3D_A_LEQUAL      Draw, if value <= refvalue
  2672.                   W3D_A_GREATER     Draw, if value > refvalue
  2673.                   W3D_A_NOTEQUAL    Draw, if value != refvalue
  2674.                   W3D_A_EQUAL       Draw, if value == refvalue
  2675.                   W3D_A_ALWAYS      always draw
  2676.        refvalue - Pointer to the alpha reference value. Must be in
  2677.                   the interval [0..1]
  2678.  
  2679.    RESULT
  2680.        One of the following:
  2681.            W3D_SUCCESS             Success
  2682.            W3D_ILLEGALINPUT        Illegal alpha mode
  2683.            W3D_UNSUPPORTEDATEST    Alpha test unsupported
  2684.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2685.  
  2686.    EXAMPLE
  2687.  
  2688.    NOTES
  2689.        Alpha testing is probably not supported on older 3D hardware.
  2690.  
  2691.    BUGS
  2692.  
  2693.    SEE ALSO
  2694.  
  2695. Warp3D/W3D_SetBlendMode                                      Warp3D/W3D_SetBlendMode
  2696.  
  2697.    NAME
  2698.        W3D_SetBlendMode -- Set the blending mode
  2699.  
  2700.    SYNOPSIS
  2701.        success = W3D_SetBlendMode(context, srcfunc, dstfunc);
  2702.        d0                         a0       d0       d1
  2703.  
  2704.        ULONG W3D_SetBlendMode(W3D_Context *, ULONG, ULONG);
  2705.  
  2706.    FUNCTION
  2707.        Sets the blending mode. Blending has to be enabled using
  2708.        W3D_SetState. For more information about the blending modes, see
  2709.        the OpenGL specs.
  2710.  
  2711.    INPUTS
  2712.        context - pointer to the W3D_Context
  2713.        srcfunc - The mode for the source pixel. Values are:
  2714.                    W3D_ZERO
  2715.                    W3D_ONE
  2716.                    W3D_DST_COLOR
  2717.                    W3D_ONE_MINUS_DST_COLOR
  2718.                    W3D_SRC_ALPHA
  2719.                    W3D_ONE_MINUS_SRC_ALPHA
  2720.                    W3D_DST_ALPHA
  2721.                    W3D_ONE_MINUS_DST_ALPHA
  2722.                    W3D_SRC_ALPHA_SATURATE
  2723.                    W3D_CONSTANT_COLOR
  2724.                    W3D_ONE_MINUS_CONSTANT_COLOR
  2725.                    W3D_CONSTANT_ALPHA
  2726.                    W3D_ONE_MINUS_CONSTANT_ALPHA
  2727.        dstfunc - Mode for the destination:
  2728.                    W3D_ZERO
  2729.                    W3D_ONE
  2730.                    W3D_SRC_COLOR
  2731.                    W3D_ONE_MINUS_SRC_COLOR
  2732.                    W3D_SRC_ALPHA
  2733.                    W3D_ONE_MINUS_SRC_ALPHA
  2734.                    W3D_DST_ALPHA
  2735.                    W3D_ONE_MINUS_DST_ALPHA
  2736.                    W3D_CONSTANT_COLOR
  2737.                    W3D_ONE_MINUS_CONSTANT_COLOR
  2738.                    W3D_CONSTANT_ALPHA
  2739.                    W3D_ONE_MINUS_CONSTANT_ALPHA
  2740.  
  2741.    RESULT
  2742.        One of the following:
  2743.            W3D_SUCCESS             Success
  2744.            W3D_ILLEGALINPUT        Illegal alpha blend mode
  2745.            W3D_UNSUPPORTEDBLEND    Mode is not supported by current driver
  2746.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2747.  
  2748.    EXAMPLE
  2749.  
  2750.    NOTES
  2751.  
  2752.    BUGS
  2753.  
  2754.    SEE ALSO
  2755.        W3D_SetState, W3D_GetState
  2756.  
  2757. Warp3D/W3D_SetChromaTestBounds                        Warp3D/W3D_SetChromaTestBounds
  2758.  
  2759.    NAME
  2760.        W3D_SetChromaTestBounds -- Set range for color keying
  2761.  
  2762.    SYNOPSIS
  2763.        res = W3D_SetChromaTestBounds(context, texture, lower, upper, mode)
  2764.        d0                            a0       a1       d0     d1     d2
  2765.  
  2766.        ULONG W3D_SetChromaTestBounds(W3D_Context *, W3D_Texture *, ULONG, ULONG, ULO
  2767. NG);
  2768.  
  2769.    FUNCTION
  2770.        Sets the bounds for chroma testing. All colors inside the range defined by
  2771.        bounds are treated normally, while pixels outside the range are not drawn.
  2772.  
  2773.    INPUTS
  2774.        context - pointer to a context to use
  2775.        texture - pointer to a texture
  2776.        lower   - lower bound. This is a 32 bit RGBA value.
  2777.        upper   - upper bound. This is a 32 bit RGBA value.
  2778.        mode    - chroma test mode
  2779.                The following values are possible:
  2780.                W3D_CHROMATEST_NONE         disable chroma testing
  2781.                W3D_CHROMATEST_INCLUSIVE    texels within the specified range pass
  2782.                                            the test (i.e. get drawn)
  2783.                W3D_CHROMATEST_EXCLUSIVE    only texels outside the specified range
  2784.                                            are drawn, others are rejected.
  2785.  
  2786.    RESULT
  2787.        One of the following:
  2788.            W3D_SUCCESS             Success
  2789.            W3D_UNSUPPORTED        Chroma keying is not supported on this hardware
  2790.  
  2791.    EXAMPLE
  2792.  
  2793.    NOTES
  2794.        The use of RGBA values (in contrast to ARGB values in most other
  2795.        functions) is due to legacy, and is preserved in future version to
  2796.        ensure compatibility.
  2797.  
  2798.    BUGS
  2799.  
  2800.    SEE ALSO
  2801.  
  2802. Warp3D/W3D_SetColorMask                                      Warp3D/W3D_SetColorMask
  2803.  
  2804.    NAME
  2805.        W3D_SetColorMask -- Set mask for drawing
  2806.  
  2807.    SYNOPSIS
  2808.        success = W3D_SetColorMask(context, red, green, blue, alpha);
  2809.        d0                         a0       d0   d1     d2    d3
  2810.  
  2811.        ULONG W3D_SetColorMask(W3D_Context *, W3D_Bool, W3D_Bool, W3D_Bool,
  2812.            W3D_Bool);
  2813.  
  2814.    FUNCTION
  2815.        This function defines the mask for all drawing operations in
  2816.        direct color mode (15/16/24/32 bit modes).
  2817.  
  2818.    INPUTS
  2819.        context     - the context
  2820.        red
  2821.        green
  2822.        blue
  2823.        alpha       - If set to FALSE, the component should be masked out.
  2824.  
  2825.    RESULT
  2826.        W3D_SUCCESS             Success
  2827.        W3D_MASKNOTSUPPORTED    Masking is not supported by the current driver
  2828.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2829.  
  2830.    EXAMPLE
  2831.  
  2832.    NOTES
  2833.  
  2834.    BUGS
  2835.  
  2836.    SEE ALSO
  2837.        W3D_SetPenMask
  2838.  
  2839. Warp3D/W3D_SetCurrentColor                                Warp3D/W3D_SetCurrentColor
  2840.  
  2841.    NAME
  2842.        W3D_SetCurrentColor -- Set color for single-color operations
  2843.  
  2844.    SYNOPSIS
  2845.        ret = W3D_SetCurrentColor(context, color);
  2846.                                  a0       a1
  2847.  
  2848.        ULONG W3D_SetCurrentColor(W3D_Context *, W3D_Color *);
  2849.  
  2850.    FUNCTION
  2851.        Defines the color to use for operations where one single color
  2852.        is used, i.e. flat-shaded opbjects. This color is only used for
  2853.        RGBA destinations.
  2854.  
  2855.    INPUTS
  2856.        context - Context pointer
  2857.        color   - Pointer to a color to use
  2858.  
  2859.    RESULT
  2860.        W3D_QUEUFAIL    Queueing failed in indirect mode
  2861.        W3D_NOTVISIBLE  Locking failed in indirect mode
  2862.  
  2863.    EXAMPLE
  2864.  
  2865.    NOTES
  2866.  
  2867.    BUGS
  2868.  
  2869.    SEE ALSO
  2870.  
  2871. Warp3D/W3D_SetCurrentPen                                    Warp3D/W3D_SetCurrentPen
  2872.  
  2873.    NAME
  2874.        W3D_SetCurrentPen -- Set pen for single-color operations
  2875.  
  2876.    SYNOPSIS
  2877.        W3D_SetCurrentPen(context, pen);
  2878.                          a0       d1
  2879.  
  2880.        void W3D_SetCurrentPen(W3D_Context *, ULONG);
  2881.  
  2882.    FUNCTION
  2883.        Define the pen to use for single-color operations, such as flat-shaded
  2884.        objects. The pen setting is olny used for chunky destinations.
  2885.  
  2886.    INPUTS
  2887.        context - a context pointer
  2888.        pen     - the pen number to use
  2889.  
  2890.    RESULT
  2891.        W3D_QUEUFAIL    Queueing failed in indirect mode
  2892.        W3D_NOTVISIBLE  Locking failed in indirect mode
  2893.  
  2894.    EXAMPLE
  2895.  
  2896.    NOTES
  2897.  
  2898.    BUGS
  2899.  
  2900.    SEE ALSO
  2901.  
  2902. Warp3D/W3D_SetDrawRegion                                    Warp3D/W3D_SetDrawRegion
  2903.  
  2904.    NAME
  2905.        W3D_SetDrawRegion -- Set the clipping rectangle
  2906.  
  2907.    SYNOPSIS
  2908.        success = W3D_SetDrawRegion(context, bm, yoffset, scissor);
  2909.        d0                          a0       a1  d1       a2
  2910.  
  2911.        ULONG W3D_SetDrawRegion(W3D_Context *, struct BitMap *, ULONG,
  2912.                W3D_Scissor *);
  2913.  
  2914.    FUNCTION
  2915.        This function defines/changes the current drawing region.
  2916.        It's used for multibuffering and clipping.
  2917.  
  2918.    INPUTS
  2919.        context - The context
  2920.        bm      - The bitmap to draw to. If NULL, the old bitmap is used
  2921.        yoffset - The vertical offset for the top-left edge. Used for
  2922.                  multibuffering.
  2923.        scissor - If not NULL, defines the scissoring region. All values
  2924.                  are taken to be relative to (0, yoffset) in the bitmap.
  2925.  
  2926.  
  2927.    RESULT
  2928.        One of the following:
  2929.            W3D_SUCCESS         Success.
  2930.            W3D_ILLEGALBITMAP   Illegal bitmap
  2931.            W3D_UNSUPPORTEDFMT  Unsupported format
  2932.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  2933.  
  2934.    EXAMPLE
  2935.  
  2936.    NOTES
  2937.        Due to constraints on bitmap placement in some drivers, bitmap data
  2938.        must be aligned to 8 byte boundaries
  2939.  
  2940.    BUGS
  2941.  
  2942.    SEE ALSO
  2943.  
  2944. Warp3D/W3D_SetDrawRegionWBM                              Warp3D/W3D_SetDrawRegionWBM
  2945.  
  2946.    NAME
  2947.        W3D_SetDrawRegionWBM -- Set the clipping rectangle for a W3D_Bitmap
  2948.  
  2949.    SYNOPSIS
  2950.        success = W3D_SetDrawRegion(context, bm, scissor);
  2951.        d0                          a0       a1  a2
  2952.  
  2953.        ULONG W3D_SetDrawRegion(W3D_Context *, W3D_Bitmap *, W3D_Scissor *);
  2954.  
  2955.    FUNCTION
  2956.        This function defines/changes the current drawing region.
  2957.        It's used for multibuffering and clipping.
  2958.        The only difference to W3D_SetDrawRegion is the bitmap used.
  2959.  
  2960.    INPUTS
  2961.        context - The context
  2962.        bm      - The bitmap to draw to. If NULL, the old bitmap is used
  2963.        scissor - If not NULL, defines the scissoring region. All values
  2964.                  are taken to be relative to (0, yoffset) in the bitmap.
  2965.  
  2966.    RESULT
  2967.        One of the following:
  2968.            W3D_SUCCESS         Success.
  2969.            W3D_ILLEGALBITMAP   Illegal bitmap
  2970.            W3D_UNSUPPORTEDFMT  Unsupported format
  2971.  
  2972.    EXAMPLE
  2973.  
  2974.    NOTES
  2975.  
  2976.    BUGS
  2977.  
  2978.    SEE ALSO
  2979.        W3D_SetDrawRegion
  2980.  
  2981. Warp3D/W3D_SetFilter                                            Warp3D/W3D_SetFilter
  2982.  
  2983.    NAME
  2984.        W3D_SetFilter -- Set the filter method
  2985.  
  2986.    SYNOPSIS
  2987.        res = W3D_SetFilter(context, texture, MinFilter, MagFilter);
  2988.        d0                  a0       a1       d0         d1
  2989.  
  2990.        ULONG W3D_SetFilter(W3D_Context *, W3D_Texture *, ULONG,
  2991.                ULONG);
  2992.  
  2993.    FUNCTION
  2994.        Set the texture`s filter mode. The filter mode used is
  2995.        texture dependant, so it is possible to set different
  2996.        filter modes for different texture.
  2997.  
  2998.    INPUTS
  2999.        context     - Pointer to a W3D_Context
  3000.        texture     - Pointer to the texture to be modified
  3001.        MinFilter   - Minification filter. May be one of the following:
  3002.                      W3D_NEAREST               no mipmapping, no filtering
  3003.                      W3D_LINEAR                no mipmapping, bilinear filtering
  3004.                      W3D_NEAREST_MIP_NEAREST   mippmapping, no filtering
  3005.                      W3D_LINEAR_MIP_NEAREST    mipmapping, bilinear filtering
  3006.                      W3D_NEAREST_MIP_LINEAR    mipmapping filtered, no filtering on 
  3007. texture
  3008.                      W3D_LINEAR_MIP_LINEAR     mippmapping with trilinear filtering
  3009.        MagFilter   - Magnification filter. One of these:
  3010.                      W3D_NEAREST               no filtering
  3011.                      W3D_LINEAR                Bilinear filtering
  3012.  
  3013.    RESULT
  3014.        A value indicating success of failure. May be one of the following:
  3015.            W3D_SUCCESS             Success
  3016.            W3D_ILLEGALINPUT        Illegal values for Min/MagFilter
  3017.            W3D_UNSUPPORTEDFILTER   Desired filter not supported by driver
  3018.            W3D_WARNING             Success, but the filter mode was adjusted,
  3019.                                      because *_MIP_* was given for a texture
  3020.                                      without mipmaps
  3021.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  3022.  
  3023.    EXAMPLE
  3024.  
  3025.    NOTES
  3026.        Some hardware may ignore the MagFilter. In this case, the MinFilter
  3027.        is used even if the texture is enlarged.
  3028.  
  3029.    BUGS
  3030.  
  3031.    SEE ALSO
  3032.        W3D_Query, W3D_GetTexFmtInfo
  3033.  
  3034. Warp3D/W3D_SetFogParams                                      Warp3D/W3D_SetFogParams
  3035.  
  3036.    NAME
  3037.        W3D_SetFogParams -- Set fog parameters
  3038.  
  3039.    SYNOPSIS
  3040.        success = W3D_SetFogParams(context, fogparams, fogmode);
  3041.        d0                         a0       a1         d1
  3042.  
  3043.        ULONG W3D_SetFogParams(W3D_Context *, W3D_Fog *, ULONG);
  3044.  
  3045.    FUNCTION
  3046.        This function defines fogging parameters and modes.
  3047.  
  3048.    INPUTS
  3049.        context     - The context to be modified
  3050.        fogparams   - Pointer to a W3D_Fog.
  3051.                      The fields fog_start and fog_end must be given if linear
  3052.                      fog is used. These values are in 'w-space', meaning 1.0 is the 
  3053. front
  3054.                      plane, and 0.0 is the back plane.
  3055.                      The density field is only used in exponential fog modes. It des
  3056. cribes
  3057.                      the falloff factor of the fog (i.e. how fast will it get thicke
  3058. r).
  3059.                      Fog_color must be given at all times.
  3060.        fogmode     - The type of fog.
  3061.                        W3D_FOG_LINEAR  Linear fog
  3062.                        W3D_FOG_EXP     Exponential fog
  3063.                        W3D_FOG_EXP_2   Square exponential fogging
  3064.  
  3065.    RESULT
  3066.        One of the following:
  3067.            W3D_SUCCESS         Success
  3068.            W3D_ILLEGALINPUT    Illegal input
  3069.            W3D_UNSUPPORTEDFOG  Fog mode is not supported by current driver
  3070.            W3D_NOTVISIBLE      Indirect mode only. Locking failed.
  3071.  
  3072.    EXAMPLE
  3073.  
  3074.    NOTES
  3075.  
  3076.    BUGS
  3077.  
  3078.    SEE ALSO
  3079.  
  3080. Warp3D/W3D_SetFrontFace                                      Warp3D/W3D_SetFrontFace
  3081.  
  3082.    NAME   
  3083.        W3D_SetFrontFace -- Set the winding order of front facing triangles
  3084.  
  3085.    SYNOPSIS
  3086.        W3D_SetFrontFace(context, direction);
  3087.                         a0       d0
  3088.  
  3089.        void W3D_SetFrontFace(W3D_Context *, ULONG);
  3090.  
  3091.    FUNCTION
  3092.        This function is used to determine which triangles should be
  3093.        considered front facing, for the purpose of backface culling.
  3094.        For more information about backface culling in general, refer
  3095.        to the OpenGL specs, or a textbook on computer graphics.
  3096.        The order specified with this function is applied to the following
  3097.        functions: W3D_DrawTriangle, W3D_DrawTriangleV, W3D_DrawTriStrip,
  3098.        W3D_DrawTriStripV, W3D_DrawTriFan, W3D_DrawTriFanV, W3D_DrawArray,
  3099.        W3D_DrawElements. For the latter two, this is only true for primitive
  3100.        type W3D_PRIMITIVE_TRIANGLE, W3D_PRIMITIVE_TRIFAN, W3D_PRIMITIVE_TRISTRIP.
  3101.  
  3102.    INPUTS
  3103.        context     - a pointer to a W3D_Context
  3104.        direction   - The winding direction of front facing triangles
  3105.                W3D_CW  A triangle is considered front facing (i.e. facing
  3106.                        the viewer) if it's vertices appear in a clockwise
  3107.                        order on screen.
  3108.                W3D_CCW A triangle is considerd front facing if it's vertices
  3109.                        appear in counter clockwise order on screen.
  3110.  
  3111.    RESULT
  3112.        None
  3113.  
  3114.    EXAMPLE
  3115.  
  3116.    NOTES
  3117.        Backface culling might or might not be supported by the hardware.
  3118.        A driver might implement this feature by using the hardware, or
  3119.        by doing the appropriate calculations itself. Whichever method used,
  3120.        it might be faster for your application to do backface culling itself, as
  3121.        it might be possible to cull polygons before projection, saving the overhead
  3122.        of first projecting and clipping a polygon, and then finally rejecting it.
  3123.        Remember that you have to turn on the appropriate state for this
  3124.        function to actually have an effec on drawing operations.
  3125.  
  3126.        Notes on primitives:
  3127.  
  3128.        Triangles are culled the "intuitive" way, i.e they are culled
  3129.        individually. The same aplies for triangle fans, as each triangle in the fan
  3130.        is culled by the same rule. For strips, however, there's one thing to note:
  3131.        With strips, the winding order is reversed for every other triangle. This mea
  3132. ns that
  3133.        when W3D_CW is set, the first triangle is considerd CW, the second CCW, the t
  3134. hird
  3135.        CW etc. This is conforming to the OpenGL way of using triangle strips. For mo
  3136. re
  3137.        information, see the description of the OpenGL primitives in the OpenGL speci
  3138. fication.
  3139.  
  3140.        Lines and points are never culled, as they have no faces at all.
  3141.  
  3142.    BUGS
  3143.  
  3144.    SEE ALSO
  3145.        W3D_SetState, W3D_DrawTriangle, W3D_DrawTriangleV, W3D_DrawTriStrip,
  3146.        W3D_DrawTriStripV, W3D_DrawTriFan, W3D_DrawTriFanV, W3D_DrawArray,
  3147.        W3D_DrawElements.
  3148.  
  3149.  
  3150. Warp3D/W3D_SetLogicOp                                          Warp3D/W3D_SetLogicOp
  3151.  
  3152.    NAME
  3153.        W3D_SetLogicOp -- Define logical operation
  3154.  
  3155.    SYNOPSIS
  3156.        success = W3D_SetLogicOp(context, operation);
  3157.        d0                       a0       d1
  3158.  
  3159.        ULONG W3D_SetLogicOp(W3D_Context *, ULONG);
  3160.  
  3161.    FUNCTION
  3162.        Set the logical operation. For further information, see the OpenGL
  3163.        specs.
  3164.  
  3165.    INPUTS
  3166.        context     - Same as ever
  3167.        operation   - The logical operation desired. Possible values are:
  3168.                        W3D_LO_CLEAR            dest = 0
  3169.                        W3D_LO_AND              dest = source & dest
  3170.                        W3D_LO_AND_REVERSE      dest = source & !dest
  3171.                        W3D_LO_COPY             dest = source
  3172.                        W3D_LO_AND_INVERTED     dest = !source & dest
  3173.                        W3D_LO_NOOP             dest = dest
  3174.                        W3D_LO_XOR              dest = source ^ dest
  3175.                        W3D_LO_OR               dest = source | dest
  3176.                        W3D_LO_NOR              dest = !(source | dest)
  3177.                        W3D_LO_EQUIV            dest = !(source ^ dest)
  3178.                        W3D_LO_INVERT           dest = !dest
  3179.                        W3D_LO_OR_REVERSE       dest = source | !dest
  3180.                        W3D_LO_COPY_INVERTED    dest = !source
  3181.                        W3D_LO_OR_INVERTED      dest = !source | dest
  3182.                        W3D_LO_NAND             dest = !(source & dest)
  3183.                        W3D_LO_SET              dest = 1
  3184.  
  3185.    RESULT
  3186.        W3D_SUCCESS             Success
  3187.        W3D_ILLEGALINPUT        Wrong operation
  3188.        W3D_UNSUPPORTEDLOGICOP  Unsupported by current driver
  3189.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  3190.  
  3191.    EXAMPLE
  3192.  
  3193.    NOTES
  3194.  
  3195.    BUGS
  3196.  
  3197.    SEE ALSO
  3198.  
  3199. Warp3D/W3D_SetPenMask                                          Warp3D/W3D_SetPenMask
  3200.  
  3201.    NAME
  3202.        W3D_SetPenMask -- set a pen mask for drawing operations
  3203.  
  3204.    SYNOPSIS
  3205.        ret = W3D_SetPenMask(context, indexmask)
  3206.        d0                   a0       d1
  3207.  
  3208.        ULONG W3D_SetPenMask(W3D_Context *, ULONG);
  3209.  
  3210.    FUNCTION
  3211.        This function defines the mask for all drawing operations in
  3212.        chunky modes (8 bit modes).
  3213.  
  3214.    INPUTS
  3215.        context     - The context to use
  3216.        indexmask   - A bitmask which is applied to chunky pixels
  3217.  
  3218.    RESULT
  3219.        W3D_SUCCESS             Success
  3220.        W3D_MASKNOTSUPPORTED    Masking is not supported by the current driver
  3221.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  3222.  
  3223.    EXAMPLE
  3224.  
  3225.    NOTES
  3226.  
  3227.    BUGS
  3228.  
  3229.    SEE ALSO
  3230.        W3D_SetColorMask
  3231.  
  3232. Warp3D/W3D_SetScissor                                          Warp3D/W3D_SetScissor
  3233.  
  3234.    NAME
  3235.        W3D_SetScissor -- (Re-) Set the clipping rectangle
  3236.  
  3237.    SYNOPSIS
  3238.        W3D_SetScissor(context,scissor);
  3239.                        a0      a1
  3240.  
  3241.        void W3D_SetScissor(W3D_Context* context, W3D_Scissor* scissor);
  3242.  
  3243.    FUNCTION
  3244.        This function sets or resets the clipping rectangle while retaining
  3245.        the current drawing region.
  3246.  
  3247.    INPUTS
  3248.        context     -   The context structure
  3249.        scissor     -   A new scissor or NULL for full-screen/no clipping
  3250.  
  3251.    RESULT
  3252.  
  3253.    EXAMPLE
  3254.  
  3255.    NOTES
  3256.  
  3257.    BUGS
  3258.  
  3259.    SEE ALSO
  3260.        W3D_SetDrawRegion()
  3261.  
  3262. Warp3D/W3D_SetState                                              Warp3D/W3D_SetState
  3263.  
  3264.    NAME
  3265.        W3D_SetState -- Enable or disable hardware and context states
  3266.  
  3267.    SYNOPSIS
  3268.        success = W3D_SetState(context, state, newstate);
  3269.        d0                     a0       d0     d1
  3270.  
  3271.        ULONG W3D_SetState(W3D_Context *, ULONG, ULONG);
  3272.  
  3273.    FUNCTION
  3274.        This function is used to enable or disable hardware
  3275.        effects or context states. Success or failure depends
  3276.        on the hardware`s ability to use the effect. Some
  3277.        hardware may not even be able to switch off some effects.
  3278.  
  3279.    INPUTS
  3280.        context     - pointer to a W3D_Context
  3281.        state       - state to be changed. Current states are listed here.
  3282.                      For a more detailed description, read the doc files.
  3283.                        W3D_AUTOTEXMANAGEMENT  automatic texture management
  3284.                        W3D_SYNCHRON           wait, until HW is idle
  3285.                        W3D_INDIRECT           buffer drawings until W3D_Flush()'ed
  3286.                        W3D_GLOBALTEXENV       global texture modes
  3287.                        W3D_DOUBLEHEIGHT       screen has double height
  3288.                        W3D_FAST               Drawing functions may modify passed st
  3289. ructures
  3290.                        W3D_TEXMAPPING         texmapping state
  3291.                        W3D_PERSPECTIVE        perspective correction state
  3292.                        W3D_GOURAUD            gouraud/flat shading
  3293.                        W3D_ZBUFFER            Z-Buffer state
  3294.                        W3D_ZBUFFERUPDATE      Z-Buffer update state
  3295.                        W3D_BLENDING           Alpha blending state
  3296.                        W3D_FOGGING            Fogging state
  3297.                        W3D_ANTI_POINT         Point antialiasing
  3298.                        W3D_ANTI_LINE          Line antialiasing
  3299.                        W3D_ANTI_POLYGON       Polygon antialiasing
  3300.                        W3D_ANTI_FULLSCREEN    Fullscreen antialiasing
  3301.                        W3D_DITHERING          dithering state
  3302.                        W3D_LOGICOP            logical operations state
  3303.                        W3D_STENCILBUFFER      stencil buffer state
  3304.                        W3D_ALPHATEST          alpha test operation
  3305.                        W3D_SPECULAR           Specular highlightung state
  3306.                        W3D_TEXMAPPING3D       3D texturemapping state
  3307.                        W3D_SCISSOR            Scissor test
  3308.                        W3D_CHROMATEST         Chroma testing (i.e. color keying)
  3309.                        W3D_CULLFACE           Backface culling
  3310.        newstate    - indicates what should be done to the state bit:
  3311.                        W3D_ENABLE             try to switch this feature on
  3312.                        W3D_DISABLE            try to switch it off
  3313.  
  3314.    RESULT
  3315.        One of two constants:
  3316.            W3D_SUCCESS            the operation was successful
  3317.            W3D_UNSUPPORTEDSTATE   the operation can not be done
  3318.  
  3319.    EXAMPLE
  3320.        if (W3D_UNSUPPORTEDSTATE == W3D_SetState(context, W3D_ANTI_FULLSCREEN,
  3321.                                        W3D_ENABLE)) {
  3322.            printf("This hardware does not support fullscreen antialiasing\n");
  3323.        } else {
  3324.            printf("Fullscreen antialiasing enabled\n");
  3325.        }
  3326.  
  3327.    NOTES
  3328.        It's not required to check the return value, however, do not assume anything.
  3329.        The current hardware may not have any restrictions on using
  3330.        i.e. Z buffering, but future hardware may.
  3331.  
  3332.    BUGS
  3333.  
  3334.    SEE ALSO
  3335.        W3D_GetState, W3D_Query
  3336.  
  3337. Warp3D/W3D_SetStencilFunc                                  Warp3D/W3D_SetStencilFunc
  3338.  
  3339.    NAME
  3340.        W3D_SetStencilFunc -- Set stencil function
  3341.  
  3342.    SYNOPSIS
  3343.        success = W3D_SetStencilFunc(context, func, refvalue, mask);
  3344.        d0                           a0       d0    d1        d2
  3345.  
  3346.        ULONG W3D_SetStencilMode(W3D_Context *, ULONG, ULONG, ULONG);
  3347.  
  3348.    FUNCTION
  3349.        Set the stencil test function, as used by the OpenGL render pipeline.
  3350.        For more information, refer to the OpenGL specs.
  3351.  
  3352.    INPUTS
  3353.        context         - W3D context structure
  3354.        func            - stencil test function. Possible value are:
  3355.                            W3D_ST_NEVER         don't draw pixel
  3356.                            W3D_ST_ALWAYS        draw always
  3357.                            W3D_ST_LESS          draw, if refvalue < ST
  3358.                            W3D_ST_LEQUAL        draw, if refvalue <= ST
  3359.                            W3D_ST_EQUAL         draw, if refvalue == ST
  3360.                            W3D_ST_GEQUAL        draw, if refvalue >= ST
  3361.                            W3D_ST_GREATER       draw, if refvalue > ST
  3362.                            W3D_ST_NOTEQUAL      draw, if refvalue != ST
  3363.        refvalue        - reference value (0-255) used for the stencil test
  3364.        mask            - mask value applied to 'refvalue' and to the stencil buffer
  3365.                          content
  3366.  
  3367.    RESULT
  3368.        W3D_SUCCESS             Success
  3369.        W3D_ILLEGALINPUT        Illegal input
  3370.        W3D_UNSUPPORTEDSTTEST   Not supported by current driver
  3371.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  3372.  
  3373.    EXAMPLE
  3374.  
  3375.    NOTES
  3376.        Stencil buffering is only supported by newer hardware
  3377.        Note that the stencil test has to be enabled using
  3378.        W3D_SetState.
  3379.  
  3380.    BUGS
  3381.  
  3382.    SEE ALSO
  3383.  
  3384. Warp3D/W3D_SetStencilOp                                      Warp3D/W3D_SetStencilOp
  3385.  
  3386.    NAME
  3387.        W3D_SetStencilOp -- Set stencil operation
  3388.  
  3389.    SYNOPSIS
  3390.        success = W3D_SetStencilOp(context, sfail, dpfail, dppass);
  3391.        d0                         a0       d0     d1      d2
  3392.  
  3393.        ULONG W3D_SetStencilOp(W3D_Context *, ULONG, ULONG, ULONG);
  3394.  
  3395.    FUNCTION
  3396.        Set the stencil test operation, as used by the OpenGL render
  3397.        pipeline. For more information, refer to the OpenGL specs.
  3398.  
  3399.    INPUTS
  3400.        context         - context pointer
  3401.        dpfail          - action, if depth test fails
  3402.        dppass          - action, if depth test succeeds. Possible values are
  3403.                          (for all three mentioned cases):
  3404.                            W3D_ST_KEEP          keep stencil buffer value
  3405.                            W3D_ST_ZERO          clear stencil buffer value
  3406.                            W3D_ST_REPLACE       replace by reference value
  3407.                            W3D_ST_INCR          increment
  3408.                            W3D_ST_DECR          decrement
  3409.                            W3D_ST_INVERT        invert bitwise
  3410.  
  3411.    RESULT
  3412.        W3D_SUCCESS             Success
  3413.        W3D_ILLEGALINPUT        Illegal input
  3414.        W3D_UNSUPPORTEDSTTEST   Not supported by current driver
  3415.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  3416.  
  3417.    EXAMPLE
  3418.  
  3419.    NOTES
  3420.        Stencil buffering is only supported on newer hardware.
  3421.        Note that the stencil test has to be enabled using
  3422.        W3D_SetState.
  3423.  
  3424.    BUGS
  3425.  
  3426.    SEE ALSO
  3427.  
  3428. Warp3D/W3D_SetTexEnv                                            Warp3D/W3D_SetTexEnv
  3429.  
  3430.    NAME
  3431.        W3D_SetTexEnv -- Set texture environment parameters
  3432.  
  3433.    SYNOPSIS
  3434.        success = W3D_SetTexEnv(context, texture, envparam, envcolor);
  3435.        d0                      a0       a1       d1        a2
  3436.  
  3437.        ULONG W3D_SetTexEnv(W3D_Context *, W3D_Texture *, ULONG,
  3438.                W3D_Color *);
  3439.  
  3440.    FUNCTION
  3441.        This function is used to set the texture environment parameters.
  3442.        These parameters define how a texture is applied to a drawn
  3443.        primitive. This also involves lit-texturing, and unlit-texturing.
  3444.  
  3445.    INPUTS
  3446.        context     - a pointer to a W3D_Context (surprise !:)
  3447.        texture     - a pointer to the texture object to be modified
  3448.        envparam    - the environment parameter. One of the following:
  3449.                      W3D_REPLACE       Unlit texturing
  3450.                      W3D_DECAL         Lit texturing using the alpha component
  3451.                                        as blending value
  3452.                      W3D_MODULATE      Lit texturing by modulation of source
  3453.                                        and destination. Modulation means
  3454.                                        source and destination are multiplied.
  3455.                      W3D_BLEND         Blending with the color in envcolor.
  3456.        envcolor    - Only specified when envparam == W3D_BLEND. The
  3457.                      given color value is used for blending with the texture.
  3458.                      Must be NULL for all other envparams.
  3459.  
  3460.    RESULT
  3461.        A value indicating success or failure. Current values are:
  3462.            W3D_SUCCESS             (guess :)
  3463.            W3D_ILLEGALINPUT        Unknown envparam given
  3464.            W3D_UNSUPPORTEDTEXENV   Not supported by the current driver
  3465.            W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  3466.  
  3467.    EXAMPLE
  3468.  
  3469.    NOTES
  3470.         The texture environment is texture-specific by default. By enabling
  3471.         the W3D_GLOBALTEXENV state using W3D_SetState() the texture environment
  3472.         can be made global for all textures (this is the case in OpenGL,
  3473.         for example).
  3474.  
  3475.    BUGS
  3476.  
  3477.    SEE ALSO
  3478.        W3D_GetTexFmtInfo
  3479.  
  3480. Warp3D/W3D_SetWrapMode                                        Warp3D/W3D_SetWrapMode
  3481.  
  3482.    NAME
  3483.        W3D_SetWrapMode -- Set the texture`s wrapping mode
  3484.  
  3485.    SYNOPSIS
  3486.        success = W3D_SetWrapMode(context, texture, mode_s, mode_t, border);
  3487.        d0                        a0        a1      d0      d1      a2
  3488.  
  3489.        ULONG W3D_SetWrapMode(W3D_Context *, W3D_Texture *, ULONG,
  3490.                ULONG, W3D_Color *);
  3491.  
  3492.    FUNCTION
  3493.        Sets the texture`s wrapping mode.
  3494.  
  3495.    INPUTS
  3496.        context     - A W3D_Context pointer
  3497.        texture     - The texture to be modified
  3498.        mode_s      - The wrapping in s direction (vertical). Can be one
  3499.                      of the following constants:
  3500.                      W3D_REPEAT    Texture is repeated
  3501.                      W3D_CLAMP     Texture is clamped, the border is filled
  3502.                                    with the color given in border.
  3503.        mode_t      - Wrapping in t direction (horizontal). Same as above.
  3504.        border      - A pointer to a W3D_Color used for the border (when clamping).
  3505.  
  3506.    RESULT
  3507.        A value indicating success or failure. One of the following:
  3508.            W3D_SUCCESS             - Success
  3509.            W3D_ILLEGALINPUT        - Illegal wrap mode
  3510.            W3D_UNSUPPORTEDWRAPMODE - The desired wrap mode is not supported
  3511.                                      by the current driver
  3512.  
  3513.    EXAMPLE
  3514.  
  3515.    NOTES
  3516.         The Virge does not allow asymmetric wrapping, therefore you should
  3517.         use the query facility, if asymmetric wrapping is possible.
  3518.  
  3519.         You should usually use W3D_REPEAT, since W3D_CLAMP is currently
  3520.         not possible with the Virge.
  3521.  
  3522.    BUGS
  3523.  
  3524.    SEE ALSO
  3525.        W3D_Query, W3D_GetTexFmtInfo
  3526.  
  3527. Warp3D/W3D_SetWriteMask                                      Warp3D/W3D_SetWriteMask
  3528.  
  3529.    NAME
  3530.        W3D_SetWriteMask -- write protext bits in the stencil buffer
  3531.  
  3532.    SYNOPSIS
  3533.        success = W3D_SetWriteMask(context, mask);
  3534.        d0                         a0       d1
  3535.  
  3536.        ULONG W3D_SetWriteMask(W3D_Context *, ULONG);
  3537.  
  3538.    FUNCTION
  3539.        Defines which bits of the stencil buffer are write protected
  3540.  
  3541.    INPUTS
  3542.        context - context pointer
  3543.        mask    - a bitmask, indicationg which bits of the
  3544.                  stencil buffer should be write-protected.
  3545.                  Setting a bit to 1 allows write access,
  3546.                  while a 0 bit protects it from writing
  3547.  
  3548.    RESULT
  3549.        W3D_SUCCESS             success
  3550.        W3D_UNSOPPORTEDTEST     Not supported by current driver
  3551.        W3D_NOTVISIBLE          Indirect mode only. Locking failed.
  3552.  
  3553.    EXAMPLE
  3554.  
  3555.    NOTES
  3556.        Stencil buffering is only supported on newer hardware.
  3557.        Note that the stencil test has to be enabled using
  3558.        W3D_SetState.
  3559.  
  3560.    BUGS
  3561.  
  3562.    SEE ALSO
  3563.  
  3564. Warp3D/W3D_SetZCompareMode                                Warp3D/W3D_SetZCompareMode
  3565.  
  3566.    NAME
  3567.        W3D_SetZCompareMode -- Set the ZBuffer compare mode
  3568.  
  3569.    SYNOPSIS
  3570.        success = W3D_SetZCompareMode(context, mode);
  3571.        d0                            a0       d1
  3572.  
  3573.        ULONG W3D_SetZCompareMode(W3d_Context *, ULONG);
  3574.  
  3575.    FUNCTION
  3576.        Set the compare mode used by ZBuffering. This mode
  3577.        determines what will be drawn depending on the z coordinate
  3578.        of the primitive to be drawn, and the value currently
  3579.        in the ZBuffer. For more information on ZBuffering, see the
  3580.        OpenGL specs, or get a textbook about Computer Graphics.
  3581.  
  3582.    INPUTS
  3583.        context - A context pointer
  3584.        mode    - The ZBuffer compare mode. One of the following values:
  3585.                    W3D_Z_NEVER             Never pass, discard pixel
  3586.                    W3D_Z_LESS              Draw if z < zbuffer
  3587.                    W3D_Z_GEQUAL            Draw if z >= zbuffer
  3588.                    W3D_Z_LEQUAL            Draw if z <= zbuffer
  3589.                    W3D_Z_GREATER           Draw if z > zbuffer
  3590.                    W3D_Z_NOTEQUAL          Draw if z != zbuffer
  3591.                    W3D_Z_EQUAL             Draw if Z == zbuffer
  3592.                    W3D_Z_ALWAYS            Always draw
  3593.  
  3594.    RESULT
  3595.        One of the following values:
  3596.            W3D_SUCCESS         Operation successful
  3597.            W3D_ILLEGLAINPUT    Illegal compare mode
  3598.            W3D_UNSUPPORTEDZCMP Comparemode unsupported by current driver
  3599.            W3D_NOTVISIBLE      Indirect mode only. Locking failed.
  3600.  
  3601.    EXAMPLE
  3602.  
  3603.    NOTES
  3604.        W3D_Z_LESS is the "normal" behavior (i.e. depth cueing), while
  3605.        W3D_Z_NOTEQUAL can be used as a poor man's stencil buffering.
  3606.  
  3607.        When mixing software and hardware rendering (for example in OpenGL
  3608.        implementations, then you should be aware, that using some of
  3609.        the Z compare modes (i.e. W3D_Z_EQUAL, W3D_Z_NOTEQUAL) might not
  3610.        work correctly, since the results of the software engine might
  3611.        not be exactly the same as the results of the hardware engine.
  3612.  
  3613.  
  3614.    BUGS
  3615.  
  3616.    SEE ALSO
  3617.        W3D_ClearZBuffer
  3618.  
  3619. Warp3D/W3D_TestMode                                              Warp3D/W3D_TestMode
  3620.  
  3621.    NAME
  3622.        W3D_TestMode -- Test Mode and return driver (V2)
  3623.  
  3624.    SYNOPSIS
  3625.        driver = W3D_TestMode(modeid);
  3626.           D0                  D0
  3627.  
  3628.        W3D_Driver *W3D_TestMode(ULONG);
  3629.  
  3630.    FUNCTION
  3631.        Given a standard ModeID, this function tests if there is a
  3632.        driver available for this DisplayID. A hardware driver is
  3633.        preferred, although it will return a CPU driver (if found)
  3634.        in case none of the installed hardware drivers support this
  3635.        screenmode.
  3636.  
  3637.    INPUTS
  3638.        modeid  -   A standard AmigaOS DisplayID
  3639.  
  3640.    RESULT
  3641.        driver  -   A pointer to a suitable driver or NULL if
  3642.                    no matching or CPU driver found.
  3643.  
  3644.    EXAMPLE
  3645.  
  3646.    NOTES
  3647.        This function will also check if the CPU driver actually supports
  3648.        this format, so be prepared to check for a NULL return value.
  3649.  
  3650.    BUGS
  3651.  
  3652.    SEE ALSO
  3653.        W3D_GetDrivers
  3654.  
  3655. Warp3D/W3D_TexCoordPointer                                Warp3D/W3D_TexCoordPointer
  3656.  
  3657.    NAME
  3658.        W3D_TexCoordPointer - Set the texture coordinate pointer (V4)
  3659.  
  3660.    SYNOPSIS
  3661.        error = W3D_TexCoordPointer(context, pointer, stride, unit, off_v, off_w, fla
  3662. gs);
  3663.        D0                           A0      A1        D0      D1    D2     D3     D4
  3664.  
  3665.        ULONG W3D_TexCoordPointer(W3D_Context*, void*, int, int, int, ULONG);
  3666.  
  3667.    FUNCTION
  3668.        This function sets the basis pointer for the texture coordinate data.
  3669.  
  3670.        When data is fetched from this array at element <n>, the pointer is cast
  3671.        into a UBYTE*, and n*stride is added to the pointer. The u coordinate is
  3672.        fetched from this address.
  3673.        To fetch the v coordinate the u address pointer is converted to an UBYTE*, an
  3674. d
  3675.        the off_v is added to this address. The result is cast back
  3676.        into a W3D_Float*, and v is fetched from there. The w coordinate is fetched
  3677.        the same way, with off_v replaced by off_w, starting from the same address
  3678.        that u was fetched from.
  3679.  
  3680.        In future versions of Warp3D this function may be called multiple times for
  3681.        different texture units on chips that support multitexturing. In this case th
  3682. e
  3683.        unit parameter specifies the texture mapping unit, starting at 0. For the
  3684.        present, unit MUST be zero.
  3685.  
  3686.    INPUTS
  3687.        context - pointer to a context obtained by W3D_CreateContext
  3688.        pointer - pointer to the texture array data or NULL to delete the pointer.
  3689.        stride  - array stride, i.e. the byte offset from one element to
  3690.                  the next.
  3691.        unit    - must be 0 for now.
  3692.        off_v   - offset to add to the pointer to obtain v address
  3693.        off_w   - offset to add to the pointer to obtain w address
  3694.        flags   - Flag word describing the array.
  3695.            possible values are
  3696.            W3D_TEXCOORD_NORMALIZED -   The texture coordinates are in the range 0..1
  3697.                                        (Normally texture coordinates are considered 
  3698. to
  3699.                                        be in the range 0..texwidth or 0..texheight)
  3700.  
  3701.    RESULT
  3702.        error   - either W3D_SUCCESS or an error code. The following errors
  3703.            may occur:
  3704.  
  3705.            W3D_SUCCESS         - no error
  3706.            W3D_ILLEGALINPUT    - driver cannot handle this layout
  3707.  
  3708.    EXAMPLE
  3709.        This example uses an array of W3D_Vertex structures as a coordinate
  3710.        array, using the standard layout of F_F_D.
  3711.  
  3712.        W3D_Vertex VertArray[1000];     // Vertex array
  3713.        ULONG error = W3D_TexCoordPointer(context, (void*)VertArray+20, sizeof(W3D_Ve
  3714. rtex)
  3715.            0, 4, -4, 0);
  3716.  
  3717.    NOTES
  3718.        Array pointers may be interleaved. That means that using the W3D_Vertex
  3719.        structures as an array works even when you use the color and texture
  3720.        coordinate pointers pointing to the same structures.
  3721.  
  3722.        Offsets and stride may be negative. No assumptions are made about these,
  3723.        and no sanity checks are performed.
  3724.  
  3725.    BUGS
  3726.  
  3727.    SEE ALSO
  3728.        W3D_VertexPointer, W3D_ColorPointer
  3729.  
  3730. Warp3D/W3D_UnLockHardware                                  Warp3D/W3D_UnLockHardware
  3731.  
  3732.    NAME
  3733.        W3D_UnLockHardware -- Release the exclusive hardware lock
  3734.  
  3735.    SYNOPSIS
  3736.        W3D_UnLockHardware(context);
  3737.                           a0
  3738.  
  3739.        void W3D_UnLockHardware(W3D_Context *);
  3740.  
  3741.    FUNCTION
  3742.        This function releases a hardware lock previously acquired
  3743.        with W3D_LockHardware.
  3744.  
  3745.    INPUTS
  3746.        context - a pointer to a W3D_Context
  3747.  
  3748.    RESULT
  3749.        None
  3750.  
  3751.    EXAMPLE
  3752.        if (W3D_SUCCESS == W3D_LockHardware(context) {
  3753.            ...
  3754.            Render some stuff
  3755.            ...
  3756.            W3D_UnLockHardware(context);
  3757.        } else {
  3758.            printf("Can`t lock hardware\n");
  3759.        }
  3760.  
  3761.    NOTES
  3762.  
  3763.    BUGS
  3764.  
  3765.    SEE ALSO
  3766.        W3D_LockHardware, W3D_GetState
  3767.  
  3768. Warp3D/W3D_UpdateTexImage                                  Warp3D/W3D_UpdateTexImage
  3769.  
  3770.    NAME
  3771.        W3D_UpdateTexImage -- Change the image of a texture or mipmap
  3772.  
  3773.    SYNOPSIS
  3774.        success = W3D_UpdateTexImage(context, texture, teximage, level, palette);
  3775.        d0                           a0       a1       a2        d1     a3
  3776.  
  3777.        ULONG W3D_UpdateTexImage(W3D_Context *, W3D_Texture *, void *,
  3778.                ULONG, ULONG *);
  3779.  
  3780.    FUNCTION
  3781.        Change the image mipmap data to the given texture. The new source
  3782.        image must have dimensions and format equal to the old one. Also,
  3783.        mipmap mode must be the same (meaning that if the old texture had
  3784.        mipmaps, so must the new).
  3785.        The resident state is unaffected. If the texture is in video ram,
  3786.        the copy there will be replaced by the new image as soon as the
  3787.        texture is used again for rendering.
  3788.  
  3789.    INPUTS
  3790.        context     - a pointer to the current context
  3791.        texture     - a pointer to the texture to be modified
  3792.        teximage    - a pointer to the new image data
  3793.        level       - the texture level to be changed. 0 is the source image,
  3794.                      while levels != 0 are the mipmaps.
  3795.        palette     - a pointer to a palette, if needed. May be NULL, even if
  3796.                      the texture is chunky, in which case the old palette
  3797.                      will remain valid. See the note to the W3D_ATO_PALETTE
  3798.                      tag in W3D_AllocTexObject for some constraints on using
  3799.                      chunky textures on 8bit screens
  3800.  
  3801.    RESULT
  3802.        One of the following:
  3803.            W3D_SUCCESS     Success
  3804.            W3D_NOMEMORY    No memory left
  3805.            W3D_NOMIPMAPS   Mipmaps are not supported by this texture object
  3806.            W3D_NOTVISIBLE  (Indirect context only) Flushing failed due to failed
  3807.                            hardware locking
  3808.  
  3809.    EXAMPLE
  3810.  
  3811.    NOTES
  3812.         Update operations are expensive, when done very often, because of
  3813.         the bus bandwidth limitation. Be especially careful when using
  3814.         texture animations. On hardware with a lot of VRAM, it might be
  3815.         better to treat all frames of such an animation as separate
  3816.         textures, so that all (or most of them) might be in VRAM.
  3817.  
  3818.    BUGS
  3819.  
  3820.    SEE ALSO
  3821.        W3D_AllocTexObj
  3822.  
  3823. Warp3D/W3D_UpdateTexSubImage                            Warp3D/W3D_UpdateTexSubImage
  3824.  
  3825.    NAME
  3826.        W3D_UpdateTexSubImage -- Change part of a texture
  3827.  
  3828.    SYNOPSIS
  3829.        success = W3D_UpdateTexSubImage(context, texture, teximage, level,
  3830.        d0                              a0       a1       a2        d1
  3831.                         palette, scissor, srcbpr);
  3832.                         a3       a4       d0
  3833.  
  3834.        ULONG W3D_UpdateTexImage(W3D_Context *, W3D_Texture *, void *,
  3835.                ULONG, ULONG *, W3D_Scissor*, ULONG);
  3836.  
  3837.    FUNCTION
  3838.        Update only part of a texture, as defined by the scissor region.
  3839.        The image data is assumed to be as large as the scissor region.
  3840.        If it's larger, the srcbpr parameter can be used to define the number
  3841.        of bytes per source row. If teximage is non-zero, the contents is copied
  3842.        into the texture. It can also be set to NULL. In this case, you can alter
  3843.        the texture image yourself in the following way: The pointer supplied with
  3844.        W3D_AllocTexObj/W3D_UpdateTexImage points to your supplied image data. You
  3845.        are allowed to change this data, BUT you MUST call W3D_UpdateTexSubImage
  3846.        after changing BEFORE doing anything else. This call must not be used inside
  3847.        a W3D_LockHardware/W3D_UnLockHardware pair. The scissor is then
  3848.        considered a "damage region", and the area defined by it will be updated.
  3849.  
  3850.        This function also recreates mipmaps, also only restricted to the scissor
  3851.        region.
  3852.  
  3853.    INPUTS
  3854.        context     - a pointer to the current context
  3855.        texture     - a pointer to the texture to be modified
  3856.        teximage    - a pointer to the new image data. Note that this pointer
  3857.                      is only "temporary", it may be reused immediatly. This is
  3858.                      different from the W3D_UpdateTexImage call.
  3859.        level       - the texture level to be changed. 0 is the source image,
  3860.                      while levels != 0 are the mipmaps.
  3861.        palette     - a pointer to a palette, if needed. May be NULL, even if
  3862.                      the texture is chunky, in which case the old palette
  3863.                      will remain valid. See the note to the W3D_ATO_PALETTE
  3864.                      tag in W3D_AllocTexObject for some constraints on using
  3865.                      chunky textures on 8bit screens
  3866.        scissor     - The given image data will be transfered into this region.
  3867.        srcbpr      - Bytes per row in source image. May be set to zero to indicate
  3868.                      that image data ans scissor size match.
  3869.  
  3870.    RESULT
  3871.        One of the following:
  3872.            W3D_SUCCESS     Success
  3873.            W3D_NOMEMORY    No memory left
  3874.            W3D_NOMIPMAPS   Mipmaps are not supported by this texture object,
  3875.                            or no mipmaps have been created yet.
  3876.            W3D_NOTVISIBLE  (Indirect context only) Flushing failed due to failed
  3877.                            hardware locking
  3878.  
  3879.    EXAMPLE
  3880.  
  3881.    NOTES
  3882.         Update operations are expensive, when done very often, because of
  3883.         the bus bandwidth limitation. Be especially careful when using
  3884.         texture animations. On hardware with a lot of VRAM, it might be
  3885.         better to treat all frames of such an animation as separate
  3886.         textures, so that all (or most of them) might be in VRAM.
  3887.  
  3888.    BUGS
  3889.  
  3890.    SEE ALSO
  3891.        W3D_AllocTexObj, W3D_UpdateTexImage
  3892.  
  3893. Warp3D/W3D_UploadTexture                                    Warp3D/W3D_UploadTexture
  3894.  
  3895.    NAME
  3896.        W3D_UploadTexture -- Transfer a texture to video ram
  3897.  
  3898.    SYNOPSIS
  3899.        success = W3D_UploadTexture(context, texture);
  3900.        d0                          a0       a1
  3901.  
  3902.        ULONG W3D_UploadTexture(W3D_Context *, W3D_Texture *);
  3903.  
  3904.    FUNCTION
  3905.        `Upload` a texture to video ram. Video memory is allocated and
  3906.        the texture image is copied there. The source texture stays in
  3907.        main memory.
  3908.  
  3909.    INPUTS
  3910.        context - a W3D_Context
  3911.        texture - the W3D_Texture to be transfered
  3912.  
  3913.    RESULT
  3914.        A value indication success or failure. One of the following:
  3915.            W3D_SUCCESS     It worked.
  3916.            W3D_NOGFXMEM    No video ram remaining.
  3917.  
  3918.    EXAMPLE
  3919.  
  3920.    NOTES
  3921.        This function does nothing when W3D_AUTOTEXMANAGEMENT is set
  3922.        in the current context`s state. Note also that transferring
  3923.        textures to video ram means transfer over the hardware`s bus
  3924.        system. Although newer cards like the CVPPC will have a PCI
  3925.        or similar bus, those bus system are still considered
  3926.        `bottlenecks`, and are usually much slower than main memory
  3927.        transfers. It is advised that you use automatic texture management,
  3928.        as this uses a LRU caching scheme. This was also used in
  3929.        ADescent, and gave about 99.7 % hit ratio.
  3930.  
  3931.    BUGS
  3932.  
  3933.    SEE ALSO
  3934.        W3D_ReleaseTexture, W3D_FlushTexture.
  3935.  
  3936. Warp3D/W3D_VertexPointer                                    Warp3D/W3D_VertexPointer
  3937.  
  3938.    NAME
  3939.        W3D_VertexPointer - Set the vertex pointer (V4)
  3940.  
  3941.    SYNOPSIS
  3942.        error = W3D_VertexPointer(context, pointer, stride, mode, flags);
  3943.        D0                          A0      A1        D0     D1    D2
  3944.  
  3945.        ULONG W3D_VertexPointer(W3D_Context*, void*, int, ULONG, ULONG);
  3946.  
  3947.    FUNCTION
  3948.        This function sets the basis pointer for the vertex coordinate data.
  3949.  
  3950.        Vertex data is fetched from the address pointed to by pointer, with three
  3951.        consecutive data elements forming one full coordinate vector consisting
  3952.        of x, y and z coordinates. The interpretation of the data is determined by
  3953.        the mode parameter (see INPUTS).
  3954.  
  3955.        Depending on the mode parameter, each "record" in the vertex array is
  3956.        considered to be 12, 16 or 24 bytes large.
  3957.  
  3958.        When data is fetched from this array, the address of an element <n> is
  3959.        computed by casting the vertex pointer to and UBYTE * and adding n*stride
  3960.        to it (where stride is fetched from the stride parameter). The resulting
  3961.        address is considered to be a W3D_Float* or W3D_Double* according to
  3962.        mode, and data is fetched from the next three addresses, equally according
  3963.        to mode.
  3964.  
  3965.    INPUTS
  3966.        context - pointer to a context obtained by W3D_CreateContext
  3967.        pointer - pointer to the vertex array data or NULL to delete the pointer
  3968.        stride  - array stride, i.e. the byte offset from one element to
  3969.                  the next.
  3970.        mode    - the layout of the vertex data in memory. Legal values are
  3971.            W3D_VERTEX_F_F_F        all three coordinates are W3D_Float
  3972.            W3D_VERTEX_F_F_D        x and y are W3D_Float, z is W3D_Double
  3973.            W3D_VERTEX_D_D_D        all three cooridnates are W3D_Double
  3974.        flags   - MUST be set to 0 for now.
  3975.  
  3976.    RESULT
  3977.        error   - either W3D_SUCCESS or an error code. The following errors
  3978.            may occur:
  3979.  
  3980.            W3D_SUCCESS         - no error
  3981.            W3D_ILLEGALINPUT    - driver cannot handle this layout
  3982.  
  3983.    EXAMPLE
  3984.        This example uses an array of W3D_Vertex structures as a coordinate
  3985.        array, using the standard layout of F_F_D.
  3986.  
  3987.        W3D_Vertex VertArray[1000];     // Vertex array
  3988.        ULONG error = W3D_VertexPointer(context, (void *)VertArray,
  3989.            sizeof(W3D_Vertex), W3D_VERTEX_F_F_D, 0);
  3990.  
  3991.    NOTES
  3992.        Array pointers may be interleaved. That means that using the W3D_Vertex
  3993.        structures as an array works even when you use the color and texture
  3994.        coordinate pointers pointing to the same structures.
  3995.  
  3996.        Offsets and stride may be negative. No assumptions are made about these,
  3997.        and no sanity checks are performed.
  3998.  
  3999.  
  4000.    BUGS
  4001.  
  4002.    SEE ALSO
  4003.        W3D_TexCoordPointer, W3D_ColorPointer
  4004.  
  4005. Warp3D/W3D_WaitIdle                                              Warp3D/W3D_WaitIdle
  4006.  
  4007.    NAME
  4008.        W3D_WaitIdle -- Wait for the hardware to become idle
  4009.  
  4010.    SYNOPSIS
  4011.        W3D_WaitIdle(context);
  4012.                     a0
  4013.  
  4014.        void W3D_WaitIdle(W3D_Context *);
  4015.  
  4016.    FUNCTION
  4017.        This function waits for the hardware to finish it`s current
  4018.        operation. It blocks your program until then.
  4019.  
  4020.    INPUTS
  4021.        context - a pointer to W3D_Context
  4022.  
  4023.    RESULT
  4024.        None
  4025.  
  4026.    EXAMPLE
  4027.        W3D_DrawSomething(context);
  4028.        W3D_WaitIdle(context);
  4029.        printf("Hardware is free again\n");
  4030.  
  4031.    NOTES
  4032.        You should use this function instead of W3D_CheckIdle if you
  4033.        just want to wait for the hardware. This function may use
  4034.        signals and/or interrupts for waiting, letting the CPU take care
  4035.        of other tasks while waiting
  4036.  
  4037.        Usually you won't need to call this function, since W3D takes care,
  4038.        that any drawing operation is only done, if the hardware is
  4039.        ready to get a new job.
  4040.  
  4041.    BUGS
  4042.  
  4043.    SEE ALSO
  4044.        W3D_CheckIdle
  4045.  
  4046. Warp3D/W3D_WriteStencilPixel                            Warp3D/W3D_WriteStencilPixel
  4047.  
  4048.    NAME
  4049.        W3D_WriteStencilPixel -- Write a pixel into the stencil buffer
  4050.  
  4051.    SYNOPSIS
  4052.        res = W3D_WriteStencilBuffer(context, x, y, st);
  4053.        d0                           a0       d0 d1 d2
  4054.  
  4055.        ULONG W3D_WriteStencilBuffer(W3D_Context *, ULONG, ULONG, ULONG);
  4056.  
  4057.    FUNCTION
  4058.        This function writes the pixel st into the stencil buffer of context,
  4059.        at position x,y.
  4060.        This function may only be used while the hardware is locked,
  4061.        except when indirect drawing is used.
  4062.  
  4063.    INPUTS
  4064.        context - a context pointer
  4065.        x,y     - position to write to
  4066.        st      - the pixel value
  4067.  
  4068.    RESULT
  4069.        A constant indicating success or failure. One of the following:
  4070.            W3D_SUCCESS             Success
  4071.            W3D_NOSTENCILBUFFER     Stencil buffering not supported by
  4072.                                      current driver
  4073.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  4074.                                        the hardware
  4075.  
  4076.    EXAMPLE
  4077.  
  4078.    NOTES
  4079.        Stencil buffering is not supported on older hardware.
  4080.  
  4081.        This function is primarly intended for OpenGL implementations,
  4082.        which might need access to the stencil buffer. This function
  4083.        is slow and should normally not be called.
  4084.  
  4085.        Important note: In indirect mode you have to make sure, that
  4086.        the stencil buffer is up to date, no Flush is internally done
  4087.        by this function. You have to call W3D_Flush, if the stencil
  4088.        buffer is not up to date yet.
  4089.  
  4090.    BUGS
  4091.        Indirect mode: the hardware is internally not locked for
  4092.        performance reasons, therefore the result might be wrong, if
  4093.        the corresponding buffer is swapped out.
  4094.  
  4095.    SEE ALSO
  4096.        W3D_AllocStencilBuffer
  4097.  
  4098. Warp3D/W3D_WriteStencilSpan                              Warp3D/W3D_WriteStencilSpan
  4099.  
  4100.    NAME
  4101.        W3D_WriteStencilSpan -- Write a span of stencil pixels
  4102.  
  4103.    SYNOPSIS
  4104.        success = W3D_WriteStencilSpan(context, x, y, n, st, mask);
  4105.        d0                             a0       d0 d1 d2 a1  a2
  4106.  
  4107.        ULONG W3D_WriteStencilSpan(W3D_Context *, ULONG, ULONG, ULONG,
  4108.                        ULONG [], UBYTE []);
  4109.  
  4110.    FUNCTION
  4111.        Write a span of n stencil pixels into the stencil buffer, starting
  4112.        at x,y. Pixels are taken from st. The mask array is used to skip pixels:
  4113.        If a byte is set to 0, the corresponding pixel is not written.
  4114.        This function may only be used while the hardware is locked,
  4115.        except when indirect drawing is used.
  4116.  
  4117.    INPUTS
  4118.        context - a context pointer
  4119.        x,y     - starting coordinates
  4120.        n       - number of pixels
  4121.        st      - array of stencil pixels
  4122.        mask    - mask array. May be NULL
  4123.  
  4124.    RESULT
  4125.        A constant indicating success or failure. One of the following:
  4126.            W3D_SUCCESS             Success
  4127.            W3D_NOSTENCILBUFFER     Stencil buffering not supported by
  4128.                                      current driver
  4129.            W3D_NOTVISIBLE          The stencil buffer can not be accessed by
  4130.                                        the hardware
  4131.  
  4132.    EXAMPLE
  4133.  
  4134.    NOTES
  4135.        Stencil buffering is not supported on older hardware.
  4136.  
  4137.        This function is primarly intended for OpenGL implementations,
  4138.        which might need access to the stencil buffer. This function
  4139.        is slow and should normally not be called.
  4140.  
  4141.        Important note: In indirect mode you have to make sure, that
  4142.        the stencil buffer is up to date, no Flush is internally done
  4143.        by this function. You have to call W3D_Flush, if the stencil
  4144.        buffer is not up to date yet.
  4145.  
  4146.    BUGS
  4147.        Indirect mode: the hardware is internally not locked for
  4148.        performance reasons, therefore the result might be wrong, if
  4149.        the corresponding buffer is swapped out.
  4150.  
  4151.    SEE ALSO
  4152.  
  4153. Warp3D/W3D_WriteZPixel                                        Warp3D/W3D_WriteZPixel
  4154.  
  4155.    NAME
  4156.        W3D_WriteZPixel -- Write a pixel into the ZBuffer
  4157.  
  4158.    SYNOPSIS
  4159.        success = W3D_WriteZPixel(context, x, y, z);
  4160.        d0                        a0       d0 d1 a1
  4161.  
  4162.        ULONG W3D_WriteZBuffer(W3D_Context *, ULONG, ULONG, W3D_Double *);
  4163.  
  4164.    FUNCTION
  4165.        Write  ZBuffer pixel z into context's ZBuffer, at x,y.
  4166.        This function may only be used while the hardware is locked,
  4167.        except when indirect drawing is used.
  4168.  
  4169.    INPUTS
  4170.        context - The context
  4171.        x,y     - Coordinates of the pixel
  4172.        z       - Pointer to a W3D_Double that's put into the zbuffer
  4173.  
  4174.    RESULT
  4175.  
  4176.    EXAMPLE
  4177.  
  4178.    NOTES
  4179.        This function is primarly intended for OpenGL implementations,
  4180.        which might need access to the Z buffer. This function
  4181.        is slow and should normally not be called.
  4182.  
  4183.        * IMPORTANT NOTE: *
  4184.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  4185.        To use this call with indirect mode, you have to manually W3D_Flush,
  4186.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  4187.  
  4188.    BUGS
  4189.        Indirect mode: the hardware is internally not locked for
  4190.        performance reasons, therefore the result might be wrong, if
  4191.        the corresponding buffer is swapped out.
  4192.  
  4193.    SEE ALSO
  4194.  
  4195. Warp3D/W3D_WriteZSpan                                          Warp3D/W3D_WriteZSpan
  4196.  
  4197.    NAME
  4198.        W3D_WriteZSpan -- Write a span of z pixels
  4199.  
  4200.    SYNOPSIS
  4201.        W3D_WriteZSpan(context, x, y, n, z, mask);
  4202.                       a0       d0 d1 d2 a1 a2
  4203.  
  4204.        W3D_WriteZSpan(W3D_Context *, ULONG, ULONG, ULONG,
  4205.                    W3D_Double [], UBYTE []);
  4206.  
  4207.    FUNCTION
  4208.        Write a span of pixels pointed to by z into the zbuffer.
  4209.        Writing begins at x,y, n pixels will be drawn. mask points
  4210.        to an equally sized array of UBYTES. A 0 in the array indicates
  4211.        that the corresponding z pixel will not be drawn.
  4212.        This function may only be used while the hardware is locked,
  4213.        except when indirect drawing is used.
  4214.  
  4215.    INPUTS
  4216.        context - a context pointer
  4217.        x,y     - the starting position
  4218.        n       - number of pixels
  4219.        z       - pointer to a span of zpixels
  4220.        mask    - pointer to mask array. May be NULL
  4221.  
  4222.    RESULT
  4223.  
  4224.    EXAMPLE
  4225.  
  4226.    NOTES
  4227.        This function is primarly intended for OpenGL implementations,
  4228.        which might need access to the Z buffer. This function
  4229.        is slow and should normally not be called.
  4230.  
  4231.        * IMPORTANT NOTE: *
  4232.        For speed reasons, this call is *NOT* compatible with indirect drawing.
  4233.        To use this call with indirect mode, you have to manually W3D_Flush,
  4234.        and, should you use any drawing calls, you'll have to W3D_Flush again.
  4235.  
  4236.    BUGS
  4237.        Indirect mode: the hardware is internally not locked for
  4238.        performance reasons, therefore the result might be wrong, if
  4239.        the corresponding buffer is swapped out.
  4240.  
  4241.    SEE ALSO
  4242.  
  4243.